diff --git a/Cargo.lock b/Cargo.lock index 5abd17b..5a37906 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,16 +18,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "ahash" -version = "0.8.11" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -39,24 +33,18 @@ dependencies = [ ] [[package]] -name = "allocator-api2" -version = "0.2.16" +name = "alloc-no-stdlib" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] -name = "android-tzdata" -version = "0.1.1" +name = "alloc-stdlib" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" dependencies = [ - "libc", + "alloc-no-stdlib", ] [[package]] @@ -107,6 +95,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "any_spawner" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9747eb01aed7603aba23f7c869d5d7e5d37aab9c3501aced42d8fdb786f1f6e3" +dependencies = [ + "futures", + "thiserror", + "wasm-bindgen-futures", +] + [[package]] name = "anyhow" version = "1.0.81" @@ -123,14 +122,50 @@ dependencies = [ ] [[package]] -name = "async-recursion" -version = "1.1.0" +name = "async-compression" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -141,28 +176,43 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", +] + +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", ] [[package]] name = "attribute-derive" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b48808b337d6b74c15ff9becfc0e139fe2b4e2b224d670a0ecdb46b0b2d3d9b" +checksum = "1f1ee502851995027b06f99f5ffbeffa1406b38d0b318a1ebfa469332c6cbafd" dependencies = [ "attribute-derive-macro", "derive-where", "manyhow", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] name = "attribute-derive-macro" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b19cbd63850ecff821c413e12846a67ec9f4ce7309c70959b94ecf9b2575ee2" +checksum = "3601467f634cfe36c4780ca9c75dea9a5b34529c1f2810676a337e7e0997f954" dependencies = [ "collection_literals", "interpolator", @@ -171,7 +221,7 @@ dependencies = [ "proc-macro2", "quote", "quote-use", - "syn 2.0.58", + "syn", ] [[package]] @@ -180,62 +230,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" -[[package]] -name = "axum" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.2.0", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "multer", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.0", - "tokio", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "backtrace" version = "0.3.71" @@ -246,7 +240,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.2", "object", "rustc-demangle", ] @@ -259,9 +253,15 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" [[package]] name = "bitflags" @@ -285,49 +285,44 @@ dependencies = [ "radium", ] +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bumpalo" version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +[[package]] +name = "bytemuck" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" + [[package]] name = "bytes" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cached" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eb5776f28a149524d1d8623035760b4454ec881e8cf3838fa8d7e1b11254b3" -dependencies = [ - "cached_proc_macro", - "cached_proc_macro_types", - "hashbrown 0.13.2", - "instant", - "once_cell", - "thiserror", -] - -[[package]] -name = "cached_proc_macro" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c878c71c2821aa2058722038a59a67583a4240524687c6028571c9b395ded61f" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cached_proc_macro_types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "camino" @@ -347,47 +342,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets 0.52.4", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clap" version = "4.5.4" @@ -419,7 +373,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -428,6 +382,17 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +[[package]] +name = "codee" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3ad3122b0001c7f140cf4d605ef9a9e2c24d96ab0b4fb4347b76de2425f445" +dependencies = [ + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "collection_literals" version = "1.0.1" @@ -440,6 +405,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "config" version = "0.14.0" @@ -454,16 +428,6 @@ dependencies = [ "toml", ] -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - [[package]] name = "const_format" version = "0.2.32" @@ -484,6 +448,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "const_str_slice_concat" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b" + [[package]] name = "convert_case" version = "0.6.0" @@ -493,6 +463,17 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -510,20 +491,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] -name = "crunchy" -version = "0.2.2" +name = "crc32fast" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] [[package]] -name = "darling" -version = "0.14.4" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "darling" @@ -531,22 +511,8 @@ version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -560,18 +526,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.58", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -580,24 +535,34 @@ version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.8", + "darling_core", "quote", - "syn 2.0.58", + "syn", ] [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive-where" version = "1.2.7" @@ -606,7 +571,40 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", +] + +[[package]] +name = "devise" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d90b0c4c777a2cad215e3c7be59ac7c15adf45cf76317009b7d096d46f651d" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71b28680d8be17a570a2334922518be6adc3f58ecc880cbb404eaeb8624fd867" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b035a542cf7abf01f2e3c4d5a7acbaebfefe120ae4efc7bde3df98186e4b8af7" +dependencies = [ + "bitflags 2.5.0", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", ] [[package]] @@ -635,6 +633,15 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[package]] +name = "either_of" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e22feb4d5cacf9f2c64902a1c35ef0f2d766e42db316a98b93992bbce669cb" +dependencies = [ + "pin-project-lite", +] + [[package]] name = "encoding_rs" version = "0.8.33" @@ -660,12 +667,57 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +[[package]] +name = "figment" +version = "0.10.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +dependencies = [ + "atomic 0.6.0", + "pear", + "serde", + "toml", + "uncased", + "version_check", +] + +[[package]] +name = "flate2" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.0", +] + [[package]] name = "fnv" version = "1.0.7" @@ -752,7 +804,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -797,6 +849,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "geo-types" version = "0.7.13" @@ -815,10 +880,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -828,16 +891,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] -name = "gloo-net" -version = "0.5.0" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gloo-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", - "http 0.2.12", + "http 1.1.0", "js-sys", "pin-project", "serde", @@ -861,6 +930,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "guardian" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "493913a18c0d7bebb75127a26a432162c59edbe06f6cf712001e3e769345e8b5" + [[package]] name = "h2" version = "0.3.26" @@ -880,31 +955,17 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" - [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] + +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -918,6 +979,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "html-escape" version = "0.2.13" @@ -960,35 +1027,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" - [[package]] name = "httparse" version = "1.8.0" @@ -1001,6 +1039,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hydration_context" +version = "0.2.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571a2756b518de368146ba56d4feeba265b0b555d176d49b8debd9ce9b69a6fa" +dependencies = [ + "futures", + "js-sys", + "once_cell", + "or_poisoned", + "pin-project-lite", + "serde", + "throw_error", + "wasm-bindgen", +] + [[package]] name = "hyper" version = "0.14.28" @@ -1013,7 +1067,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body 0.4.6", + "http-body", "httparse", "httpdate", "itoa", @@ -1025,25 +1079,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -1051,51 +1086,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper", "native-tls", "tokio", "tokio-native-tls", ] -[[package]] -name = "hyper-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" -dependencies = [ - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.2.0", - "pin-project-lite", - "socket2", - "tokio", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -1114,22 +1110,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", + "serde", ] [[package]] -name = "instant" -version = "0.1.12" +name = "inlinable_string" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" [[package]] name = "interpolator" @@ -1150,10 +1144,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "itertools" -version = "0.12.1" +name = "is-terminal" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1165,10 +1170,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "js-sys" -version = "0.3.69" +name = "jiff" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "b9d9d414fc817d3e3d62b2598616733f76c4cc74fbac96069674739b881295c8" +dependencies = [ + "jiff-tzdb-platform", + "windows-sys 0.52.0", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91335e575850c5c4c673b9bd467b0e025f164ca59d0564f69d0c2ee0ffad4653" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9835f0060a626fe59f160437bc725491a6af23133ea906500027d1bd2f8f4329" +dependencies = [ + "jiff-tzdb", +] + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1188,86 +1218,46 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "leaflet" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ca4f4ecc791314ac38d50a5af6dc6506977aa7c7f0231b1bfd66989a9c4be3" -dependencies = [ - "js-sys", - "paste", - "url", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "leptos" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd996d00a55895327b2eb5d2d7d440ab756b4a9fe43ec78411c74199306808c" +checksum = "87a99b3ca2611376257a8b29466dc5ebf22c6bbed8715f86847808c269844785" dependencies = [ + "any_spawner", "cfg-if", + "either_of", + "futures", + "hydration_context", "leptos_config", "leptos_dom", + "leptos_hot_reload", "leptos_macro", - "leptos_reactive", "leptos_server", + "oco_ref", + "or_poisoned", + "paste", + "reactive_graph", + "rustc-hash", + "send_wrapper", + "serde", + "serde_qs", "server_fn", - "tracing", + "slotmap", + "tachys", + "thiserror", + "throw_error", "typed-builder", "typed-builder-macro", "wasm-bindgen", "web-sys", ] -[[package]] -name = "leptos-leaflet" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65a03c5300f8ad496c3029e4e0f565c7e60d42f7ea7a1a69d2cf1e8414e2771" -dependencies = [ - "getrandom", - "js-sys", - "leaflet", - "leptos", - "leptos_meta", - "paste", - "rand", - "serde-wasm-bindgen", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "leptos_axum" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0572d6549c7b4d59d6c6c8240c0faa25c1d20af144db7b2e372ffc537fd0aaa3" -dependencies = [ - "axum", - "cfg-if", - "futures", - "http-body-util", - "leptos", - "leptos_integration_utils", - "leptos_macro", - "leptos_meta", - "leptos_router", - "once_cell", - "parking_lot", - "serde_json", - "server_fn", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "leptos_config" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc190458a62433fb1d31f65f1afe7f1044650c667cdf9166956b48907ac821bd" +checksum = "04c89503f59940cef245827075362107d4d53f9a710db31bfc361151866ba39e" dependencies = [ "config", "regex", @@ -1278,39 +1268,24 @@ dependencies = [ [[package]] name = "leptos_dom" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffd84c459d7c517fb8c9bfff704e819f3e6a2f5baf574d8636cb23840323d0a" +checksum = "b108dc3960fac70b98d2302e568cd51c4d09255f1925bb797eba95575acc69b8" dependencies = [ - "async-recursion", - "cfg-if", - "drain_filter_polyfill", - "futures", - "getrandom", - "html-escape", - "indexmap", - "itertools", "js-sys", - "leptos_reactive", - "once_cell", - "pad-adapter", - "paste", - "rustc-hash", - "serde", - "serde_json", - "server_fn", - "smallvec", - "tracing", + "or_poisoned", + "reactive_graph", + "send_wrapper", + "tachys", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", ] [[package]] name = "leptos_hot_reload" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2f157fc6d4a356e3dd2734c6a65cba9e5eadb7c7cfd979c0adb752d293dba1" +checksum = "10230c3b99bffd7490f192c54e02f0b35411d08089aba7f662d78be2adfbb736" dependencies = [ "anyhow", "camino", @@ -1320,29 +1295,15 @@ dependencies = [ "quote", "rstml", "serde", - "syn 2.0.58", + "syn", "walkdir", ] -[[package]] -name = "leptos_integration_utils" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046984e2ca5e2136eb1021ced1f1dc1725b4045f4a370d28f2594b23604477ac" -dependencies = [ - "futures", - "leptos", - "leptos_config", - "leptos_hot_reload", - "leptos_meta", - "tracing", -] - [[package]] name = "leptos_macro" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69a20596eb0afe56296d3187c8f46680bb8ea1df58b6566e2588c9c53c549581" +checksum = "0e948a21600d13a6e91d9a0fb56de9c58692f79890caeaec7dabb1cd63e8ec92" dependencies = [ "attribute-derive", "cfg-if", @@ -1351,103 +1312,33 @@ dependencies = [ "itertools", "leptos_hot_reload", "prettyplease", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", "rstml", "server_fn_macro", - "syn 2.0.58", - "tracing", + "syn", "uuid", ] [[package]] -name = "leptos_meta" -version = "0.6.10" +name = "leptos_server" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a85d2f3e3c4eb7ffb8a97abe6c79eefcb0a2c6ae5bacd7645b5a5df1ba0a212" +checksum = "1fd1abdb945660f19f7510bdf208069d3bc391aa9bb7183aa58e4af5429e6115" dependencies = [ - "cfg-if", - "indexmap", - "leptos", - "tracing", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "leptos_reactive" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9152b4b9af932896ae69d08b8ab7108513b9cdddf8e2922d5c234dab7ac9af" -dependencies = [ - "base64 0.22.0", - "cfg-if", + "any_spawner", + "base64 0.22.1", + "codee", "futures", - "indexmap", - "js-sys", - "paste", - "pin-project", - "rustc-hash", - "self_cell", - "serde", - "serde-wasm-bindgen", - "serde_json", - "slotmap", - "thiserror", - "tokio", - "tracing", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "leptos_router" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e42ebcdc1663ab03f249b91c367daa00f164d84c5f30eaec492bd45dffd3148" -dependencies = [ - "cached", - "cfg-if", - "gloo-net", - "itertools", - "js-sys", - "lazy_static", - "leptos", - "leptos_integration_utils", - "leptos_meta", - "linear-map", - "lru", - "once_cell", - "percent-encoding", - "regex", + "hydration_context", + "or_poisoned", + "reactive_graph", "send_wrapper", "serde", "serde_json", - "serde_qs", - "thiserror", - "tracing", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "leptos_server" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed1e82ded6bfbfd61ad2f77066a789b94dc889513a47223e3c6a3e8ca2b109f" -dependencies = [ - "inventory", - "lazy_static", - "leptos_macro", - "leptos_reactive", - "serde", "server_fn", - "thiserror", - "tracing", + "tachys", ] [[package]] @@ -1467,10 +1358,6 @@ name = "linear-map" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" -dependencies = [ - "serde", - "serde_test", -] [[package]] name = "linux-raw-sys" @@ -1495,12 +1382,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "lru" -version = "0.11.1" +name = "loom" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "hashbrown 0.14.3", + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", ] [[package]] @@ -1512,7 +1405,7 @@ dependencies = [ "manyhow-macros", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1533,10 +1426,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0fc1b6107fbd06c96e5e481fcf3e6575b873eb84f5b68f1f5706cde0fed42c4" [[package]] -name = "matchit" -version = "0.7.3" +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] [[package]] name = "memchr" @@ -1550,16 +1446,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1575,6 +1461,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -1601,6 +1496,8 @@ dependencies = [ "memchr", "mime", "spin", + "tokio", + "tokio-util", "version_check", ] @@ -1610,6 +1507,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + [[package]] name = "native-tls" version = "0.2.11" @@ -1628,6 +1531,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "next_tuple" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3615947b64839fe27e9ee557f282b04ad13ead564a543a6548b0cfd17457ff4" + [[package]] name = "nom" version = "7.1.3" @@ -1638,6 +1547,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num" version = "0.2.1" @@ -1673,6 +1592,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.46" @@ -1721,7 +1646,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -1734,6 +1659,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "oco_ref" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b94982fe39a861561cf67ff17a7849f2cedadbbad960a797634032b7abb998" +dependencies = [ + "serde", + "thiserror", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -1763,7 +1698,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1785,16 +1720,28 @@ dependencies = [ ] [[package]] -name = "pad-adapter" +name = "or_poisoned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c04f5d74368e4d0dfe06c45c8627c81bd7c317d52762d118fb9b3076f6420fd" + +[[package]] +name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d80efc4b6721e8be2a10a5df21a30fa0b470f1539e53d8b4e6e75faf938b63" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1825,6 +1772,29 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pear" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdeeaa00ce488657faba8ebf44ab9361f9365a97bd39ffb8a60663f57ff4b467" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bab5b985dc082b345f812b7df84e1bef27e7207b39e448439ba8bd69c93f147" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1848,7 +1818,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1873,29 +1843,22 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" name = "plcom" version = "0.1.0" dependencies = [ - "axum", - "chrono", - "console_error_panic_hook", - "gen-wallpapers", - "getrandom", - "http 1.1.0", + "jiff", "leptos", - "leptos-leaflet", - "leptos_axum", - "leptos_meta", - "leptos_router", - "rand", + "nanorand", + "rocket", + "rocket_async_compression", "serde", "serde_json", "tailwind_fuse", - "thiserror", - "tokio", - "tower", - "tower-http", - "tracing", - "wasm-bindgen", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1904,12 +1867,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn", ] [[package]] @@ -1935,6 +1898,28 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "proc-macro-utils" version = "0.8.0" @@ -1948,9 +1933,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1963,7 +1948,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", "version_check", "yansi", ] @@ -1997,7 +1982,7 @@ dependencies = [ "proc-macro-utils", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2036,6 +2021,55 @@ dependencies = [ "getrandom", ] +[[package]] +name = "reactive_graph" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cdfe96bdf3d95c9bdd15af1cfc82252ef85c026ea960f83df53feca9fec61a" +dependencies = [ + "any_spawner", + "async-lock", + "futures", + "guardian", + "hydration_context", + "or_poisoned", + "pin-project-lite", + "rustc-hash", + "send_wrapper", + "serde", + "slotmap", + "thiserror", + "web-sys", +] + +[[package]] +name = "reactive_stores" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fa994eaec6638c22faeedd4524cbd5a3653e7f32a67e130a60a0c8c9e1ee81" +dependencies = [ + "guardian", + "itertools", + "or_poisoned", + "paste", + "reactive_graph", + "reactive_stores_macro", + "rustc-hash", +] + +[[package]] +name = "reactive_stores_macro" +version = "0.1.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d7cfe1c6d9f1005605ac7c928aef7e037d6808d6eda0429e73f0ca90cb9cb5" +dependencies = [ + "convert_case", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -2045,6 +2079,26 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "regex" version = "1.10.4" @@ -2053,8 +2107,17 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -2065,9 +2128,15 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.3", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.3" @@ -2087,8 +2156,8 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "http-body", + "hyper", "hyper-tls", "ipnet", "js-sys", @@ -2102,7 +2171,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -2115,15 +2184,110 @@ dependencies = [ ] [[package]] -name = "rstml" -version = "0.11.2" +name = "rocket" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" +checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f" dependencies = [ + "async-stream", + "async-trait", + "atomic 0.5.3", + "binascii", + "bytes", + "either", + "figment", + "futures", + "indexmap", + "log", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite", + "rand", + "ref-cast", + "rocket_codegen", + "rocket_http", + "serde", + "state", + "tempfile", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "ubyte", + "version_check", + "yansi", +] + +[[package]] +name = "rocket_async_compression" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf1f3cb4a0cc79d44f6e5eaf7841134c6acdb756fd84286e595de0d5dcbcc13" +dependencies = [ + "async-compression", + "futures", + "lazy_static", + "log", + "rocket", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46" +dependencies = [ + "devise", + "glob", + "indexmap", + "proc-macro2", + "quote", + "rocket_http", + "syn", + "unicode-xid", + "version_check", +] + +[[package]] +name = "rocket_http" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9" +dependencies = [ + "cookie", + "either", + "futures", + "http 0.2.12", + "hyper", + "indexmap", + "log", + "memchr", + "pear", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde", + "smallvec", + "stable-pattern", + "state", + "time", + "tokio", + "uncased", +] + +[[package]] +name = "rstml" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51187e564f12336ef40cd04f6f4d805d6919188001dcf1e0a021898ea0fe28ce" +dependencies = [ + "derive-where", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.58", + "syn", "syn_derive", "thiserror", ] @@ -2147,9 +2311,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" @@ -2203,6 +2367,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -2232,12 +2402,6 @@ dependencies = [ "libc", ] -[[package]] -name = "self_cell" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" - [[package]] name = "send_wrapper" version = "0.6.0" @@ -2256,17 +2420,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - [[package]] name = "serde_derive" version = "1.0.197" @@ -2275,7 +2428,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2289,21 +2442,11 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - [[package]] name = "serde_qs" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" +checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ "percent-encoding", "serde", @@ -2319,15 +2462,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_test" -version = "1.0.176" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2f49ace1498612d14f7e0b8245519584db8299541dfe31a06374a828d620ab" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2342,31 +2476,27 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a46a2ffdecb81430ecfb995989218a18b6e94c1ead50cb806b5927c986a8ce" +checksum = "166689e862d227e838f359cce92681cf338e60a8cbcbd029bae03548d5a6d785" dependencies = [ - "axum", "bytes", - "ciborium", "const_format", "dashmap", "futures", "gloo-net", "http 1.1.0", - "http-body-util", - "hyper 1.2.0", "inventory", "js-sys", "once_cell", + "pin-project-lite", "send_wrapper", "serde", "serde_json", "serde_qs", "server_fn_macro_default", "thiserror", - "tower", - "tower-layer", + "throw_error", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2377,26 +2507,44 @@ dependencies = [ [[package]] name = "server_fn_macro" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a248dedb786315ba738f3618dbd65ba0c1b22ebea76f15a3e96a04643a73f" +checksum = "4230cd52992681cc370885a613a5aad9fb56d61995b789de5c42dc55ff628e98" dependencies = [ "const_format", "convert_case", "proc-macro2", "quote", - "syn 2.0.58", + "syn", "xxhash-rust", ] [[package]] name = "server_fn_macro_default" -version = "0.6.10" +version = "0.7.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af19028131998f73134a9adcdefb6d9de2eeaed5b01ef74f6d902a1659d2a32f" +checksum = "b8d4b8ee78096ff2b09c64afacb83f023f4edfdace60c00590b2aea215fea8a4" dependencies = [ "server_fn_macro", - "syn 2.0.58", + "syn", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", ] [[package]] @@ -2414,7 +2562,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ - "serde", "version_check", ] @@ -2440,6 +2587,24 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + [[package]] name = "strsim" version = "0.10.0" @@ -2454,20 +2619,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -2483,7 +2637,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2492,12 +2646,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "sync_wrapper" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" - [[package]] name = "system-configuration" version = "0.5.1" @@ -2520,10 +2668,42 @@ dependencies = [ ] [[package]] -name = "tailwind_fuse" -version = "0.2.0" +name = "tachys" +version = "0.1.0-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540816d3bd4e690d75d0cfcad47c8129487f0f730fc32ffa913aeef0b7634a8" +checksum = "b24784a27f391dedcc8160ea4b2ba7a6ad0f5484ca89ff88a10494f960aee270" +dependencies = [ + "any_spawner", + "const_str_slice_concat", + "drain_filter_polyfill", + "either_of", + "futures", + "html-escape", + "indexmap", + "itertools", + "js-sys", + "linear-map", + "next_tuple", + "oco_ref", + "once_cell", + "or_poisoned", + "parking_lot", + "paste", + "reactive_graph", + "reactive_stores", + "rustc-hash", + "send_wrapper", + "slotmap", + "throw_error", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "tailwind_fuse" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9d32d52c3191836fe1858b6b38442d1e536eeb11883b2041e6db080a208c2d" dependencies = [ "nom", "tailwind_fuse_macro", @@ -2531,14 +2711,14 @@ dependencies = [ [[package]] name = "tailwind_fuse_macro" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473b0a76a09cf00567794d9aa58fafa568ddb66053cf75ae776f7034584c2e46" +checksum = "89fd8a13e8e105a886fe9d15aa60580602be9ee9a17235e552f19faa3d7834f4" dependencies = [ - "darling 0.20.8", + "darling", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2555,22 +2735,72 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "b607164372e89797d78b8e23a6d67d5d1038c1c65efd52e1389ef8b77caba2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "throw_error" +version = "0.2.0-rc1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84bf87b0433891f1029e5868d4de3a11e794a206899082ebb4e82fca139b0d70" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", ] [[package]] @@ -2600,6 +2830,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.48.0", @@ -2613,7 +2844,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2626,6 +2857,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -2635,8 +2877,6 @@ dependencies = [ "bytes", "futures-core", "futures-sink", - "futures-util", - "hashbrown 0.14.3", "pin-project-lite", "tokio", "tracing", @@ -2676,53 +2916,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.5.0", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -2735,7 +2928,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2749,7 +2941,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2759,6 +2951,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -2769,30 +2991,40 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-builder" -version = "0.18.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444d8748011b93cb168770e8092458cb0f8854f931ff82fdf6ddfbd72a9c933e" +checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.18.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563b3b88238ec95680aef36bdece66896eaa7ce3c0f1b4f39d38fb2435261352" +checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] -name = "unicase" -version = "2.7.0" +name = "ubyte" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" dependencies = [ + "serde", +] + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "serde", "version_check", ] @@ -2854,13 +3086,19 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2900,26 +3138,27 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-shared", ] @@ -2937,9 +3176,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2947,22 +3186,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -2979,9 +3218,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3019,12 +3258,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-core" -version = "0.52.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.48.5", ] [[package]] @@ -3180,32 +3419,15 @@ dependencies = [ [[package]] name = "xxhash-rust" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "yansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", + "is-terminal", ] diff --git a/Cargo.toml b/Cargo.toml index 2cfd947..e971e17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,12 +4,3 @@ members = ["crates/gen-wallpapers", "crates/plcom"] [workspace.dependencies] serde = "1.0" - -# Defines a size-optimized profile for the WASM bundle in release mode -[profile.wasm-release] -inherits = "release" -opt-level = 'z' -lto = true -codegen-units = 1 -panic = "abort" - diff --git a/crates/gen-wallpapers/src/lib.rs b/crates/gen-wallpapers/src/lib.rs index f94e470..e1f16ec 100644 --- a/crates/gen-wallpapers/src/lib.rs +++ b/crates/gen-wallpapers/src/lib.rs @@ -4,7 +4,7 @@ use location::Gps; use location::Location; use location::parse_coordinates; -use exif::{DateTime, Exif, In, Tag}; +use exif::{DateTime, In, Tag}; use serde::Serialize; use std::fs::ReadDir; use std::io::BufReader; diff --git a/crates/plcom/Cargo.toml b/crates/plcom/Cargo.toml index 71142c4..a9ab10d 100644 --- a/crates/plcom/Cargo.toml +++ b/crates/plcom/Cargo.toml @@ -3,116 +3,15 @@ name = "plcom" version = "0.1.0" edition = "2021" -[lib] -crate-type = ["cdylib", "rlib"] - [dependencies] -# leptos + axum -axum = { version = "0.7", optional = true } -console_error_panic_hook = "0.1" -leptos = { version = "0.6" } -leptos_axum = { version = "0.6", optional = true } -leptos_meta = { version = "0.6" } -leptos_router = { version = "0.6" } -tokio = { version = "1", features = ["rt-multi-thread"], optional = true } -tower = { version = "0.4", optional = true } -tower-http = { version = "0.5", features = ["fs"], optional = true } -wasm-bindgen = "=0.2.93" -thiserror = "1" -tracing = { version = "0.1", optional = true } -http = "1" - -# external crates -tailwind_fuse = { version = "0.2.0", features = ["variant"] } -chrono = "0.4.37" -getrandom = { version = "0.2", features = ["js"] } -rand = "0.8.5" -leptos-leaflet = "0.8.0" +rocket = "0.5" +leptos = {version = "0.7.0-rc1" , features = ["ssr"]} +jiff = "0.1" +rocket_async_compression = "0.6" +nanorand = { version = "0.7", features = ["chacha"] } +tailwind_fuse = { version = "0.3", features = ["variant"] } [build-dependencies] serde = { workspace = true } serde_json = "1.0" -gen-wallpapers = { path = "../../crates/gen-wallpapers" } -[features] -hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate", "leptos-leaflet/hydrate"] -ssr = [ - "dep:axum", - "dep:tokio", - "dep:tower", - "dep:tower-http", - "dep:leptos_axum", - "leptos/ssr", - "leptos_meta/ssr", - "leptos_router/ssr", - "dep:tracing", - "leptos-leaflet/ssr" -] - -[package.metadata.leptos] -# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name -output-name = "plcom" - -# The site root folder is where cargo-leptos generate all output. WARNING: all content of this folder will be erased on a rebuild. Use it in your server setup. -site-root = "target/site" - -# The site-root relative folder where all compiled output (JS, WASM and CSS) is written -# Defaults to pkg -site-pkg-dir = "pkg" - -# The tailwind input file. -# -# Optional, Activates the tailwind build -tailwind-input-file = "css/main.css" - -# The tailwind config file. -# -# Optional, defaults to "tailwind.config.js" which if is not present -# is generated for you -tailwind-config-file = "tailwind.config.js" - -# Assets source dir. All files found here will be copied and synchronized to site-root. -# The assets-dir cannot have a sub directory with the same name/path as site-pkg-dir. -# -# Optional. Env: LEPTOS_ASSETS_DIR. -assets-dir = "../../public" - -# Additional files triggering recompilation -watch-additional-files = ["resume.json", "wallpapers.json"] - -# The IP and port (ex: 127.0.0.1:3000) where the server serves the content. Use it in your server setup. -site-addr = "0.0.0.0:3000" - -# The port to use for automatic reload monitoring -reload-port = 3001 - -# The browserlist query used for optimizing the CSS. -browserquery = "defaults" - -# The environment Leptos will run in, usually either "DEV" or "PROD" -env = "DEV" - -# The features to use when compiling the bin target -# -# Optional. Can be over-ridden with the command line parameter --bin-features -bin-features = ["ssr"] - -# If the --no-default-features flag should be used when compiling the bin target -# -# Optional. Defaults to false. -bin-default-features = false - -# The features to use when compiling the lib target -# -# Optional. Can be over-ridden with the command line parameter --lib-features -lib-features = ["hydrate"] - -# If the --no-default-features flag should be used when compiling the lib target -# -# Optional. Defaults to false. -lib-default-features = false - -# The profile to use for the lib target when compiling for release -# -# Optional. Defaults to "release". -lib-profile-release = "wasm-release" diff --git a/crates/plcom/src/app.rs b/crates/plcom/src/app.rs deleted file mode 100644 index 50b7e53..0000000 --- a/crates/plcom/src/app.rs +++ /dev/null @@ -1,71 +0,0 @@ -use crate::{ - error_template::{AppError, ErrorTemplate}, - pages::*, - Link, UnderlineLink, -}; -use leptos::*; -use leptos_meta::*; -use leptos_router::*; -use tailwind_fuse::*; - -#[component] -pub fn App() -> impl IntoView { - // Provides context that manages stylesheets, titles, meta tags, etc. - provide_meta_context(); - let formatter = |text| format!("{text} — Philippe Loctaux"); - - view! { - - - - - // sets the document title - - - <Meta name="viewport" content="width=device-width"/> - - // favicon - <Link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/> - <Link rel="icon" type_="image/png" sizes="32x32" href="/favicon-32x32.png"/> - <Link rel="icon" type_="image/png" sizes="16x16" href="/favicon-16x16.png"/> - <Link rel="manifest" href="/site.webmanifest"/> - <Link - rel="mask-icon" - href="/safari-pinned-tab.svg" - attrs=vec![("color", Attribute::String(Oco::Borrowed("#0c4a6e")))] - /> - <Meta name="msapplication-TileColor" content="#0c4a6e"/> - <Meta name="theme-color" content="#0c4a6e"/> - - // stats - <Script - defer="true" - src="https://plausible.y.z.x4m3.rocks/js/script.js" - attrs=vec![("data-domain", Attribute::String(Oco::Borrowed("philippeloctaux.com")))] - /> - - // actual routes - <Router fallback=|| { - let mut outside_errors = Errors::default(); - outside_errors.insert_with_default_key(AppError::NotFound); - view! { <ErrorTemplate outside_errors/> }.into_view() - }> - <Body class=tw_join!("flex", "flex-col", "min-h-screen", "bg-gray-900", "text-white")/> - <main class=tw_join!("flex-grow")> - <Routes> - <Route path="" view=RootPage ssr=SsrMode::Async/> - <Route path="email" view=EmailPage/> - <Route path="wallpapers" view=WallpapersPage/> - </Routes> - </main> - <footer class=tw_join!("bg-black")> - <div class=tw_join!("container", "mx-auto", "px-4", "py-8")> - <p> - "© 2015 - "{crate::get_year()}" Philippe Loctaux, made with " - <UnderlineLink link=Link::new("https://leptos.dev", "Leptos")/> - </p> - </div> - </footer> - </Router> - } -} diff --git a/crates/plcom/src/cache.rs b/crates/plcom/src/cache.rs new file mode 100644 index 0000000..b327627 --- /dev/null +++ b/crates/plcom/src/cache.rs @@ -0,0 +1,57 @@ +use rocket::fairing::{self, Fairing}; +use rocket::http::{ContentType, Header}; +use rocket::{Request, Response}; + +#[derive(Debug)] +pub struct CacheControl { + duration_secs: u32, + types: Vec<ContentType>, + routes: Vec<&'static str>, +} + +impl Default for CacheControl { + fn default() -> Self { + CacheControl { + duration_secs: 60 * 60, // 60 secs * 60 minutes + types: vec![ContentType::HTML, ContentType::CSS, ContentType::JavaScript], + routes: vec!["/wallpapers", "/pub", "/images", "/icons"], + } + } +} + +#[rocket::async_trait] +impl Fairing for CacheControl { + fn info(&self) -> fairing::Info { + fairing::Info { + name: "Cache Control", + kind: fairing::Kind::Response, + } + } + + async fn on_response<'r>(&self, request: &'r Request<'_>, response: &mut Response<'r>) { + let mut should_cache = false; + + // Check if content type matches + if let Some(content_type) = response.content_type() { + if self.types.contains(&content_type) { + println!("going to cache {:?}", content_type); + should_cache = true; + } + } + + // TODO: make sure if it is either + + // Check if route matches + self.routes + .iter() + .filter(|s| request.uri().path().starts_with(*s)) + .for_each(|_| should_cache = true); + + if should_cache { + response.set_header(Header::new( + "Cache-Control", + format!("public, max-age={}", self.duration_secs), + )); + } + } +} diff --git a/crates/plcom/src/common.rs b/crates/plcom/src/common.rs index b286fbb..cf91b75 100644 --- a/crates/plcom/src/common.rs +++ b/crates/plcom/src/common.rs @@ -1,11 +1,6 @@ pub mod icon; pub mod link; -pub fn get_year() -> i32 { - use chrono::Datelike; - chrono::Utc::now().year() -} - #[derive(Clone, PartialEq)] pub struct Date { pub year: u32, @@ -14,7 +9,22 @@ pub struct Date { impl std::fmt::Display for Date { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}-{:02}", self.year, self.month) + let month = match self.month { + 1 => "January", + 2 => "Februrary", + 3 => "March", + 4 => "April", + 5 => "May", + 6 => "June", + 7 => "July", + 8 => "August", + 9 => "September", + 10 => "October", + 11 => "November", + 12 => "December", + _ => panic!("wtf not a month"), + }; + write!(f, "{month} {}", self.year) } } @@ -65,18 +75,14 @@ pub mod resume { pub not_available: bool, } - use crate::{Link, OutlineButtonLink}; - use http::Uri; - use leptos::*; + use crate::common::link::{Link, outline_button_link}; + use leptos::prelude::*; use tailwind_fuse::tw_join; - impl IntoView for ResumeLink { - fn into_view(self) -> View { + impl IntoAny for ResumeLink { + fn into_any(self) -> AnyView { if !self.not_available { - let link = Link { - label: self.label.into(), - uri: Uri::from_static(self.uri), - }; - view! { <OutlineButtonLink link=link/> }.into_view() + let link = Link::parse(self.uri, self.label); + outline_button_link(link).into_any() } else { view! { <span class=tw_join!( @@ -85,7 +91,7 @@ pub mod resume { "items-center" )>{self.label}</span> } - .into_view() + .into_any() } } } @@ -120,6 +126,12 @@ pub mod wallpapers { pub longitude: f32, } + impl std::fmt::Display for Gps { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "[{}, {}]", self.latitude, self.longitude) + } + } + #[derive(Clone, Copy)] pub struct Location { pub precise: &'static str, @@ -128,8 +140,19 @@ pub mod wallpapers { impl Wallpaper { pub fn random() -> Option<&'static Wallpaper> { - let random_value = rand::Rng::gen_range(&mut rand::thread_rng(), 0..WALLPAPERS.len()); - WALLPAPERS.get(random_value) + use nanorand::{ChaCha20, Rng}; + use std::ops::Range; + + let range = Range { + start: 0, + end: WALLPAPERS.len(), + }; + + WALLPAPERS.get(ChaCha20::new().generate_range(range)) + } + + pub fn find(filename: &str) -> Option<&'static Wallpaper> { + WALLPAPERS.iter().find(|w| w.filename.contains(filename)) } } diff --git a/crates/plcom/src/common/icon.rs b/crates/plcom/src/common/icon.rs index 58b52c3..9a7578f 100644 --- a/crates/plcom/src/common/icon.rs +++ b/crates/plcom/src/common/icon.rs @@ -1,4 +1,4 @@ -use leptos::*; +use leptos::prelude::*; use tailwind_fuse::tw_join; #[derive(Clone, Copy, PartialEq)] @@ -15,8 +15,8 @@ pub enum Icon { Map, } -impl IntoView for Icon { - fn into_view(self) -> View { +impl IntoAny for Icon { + fn into_any(self) -> AnyView { match self { Self::Email => view! { <svg @@ -33,7 +33,7 @@ impl IntoView for Icon { d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" ></path> </svg> - }.into_view(), + }.into_any(), Self::Link => view! { <svg @@ -45,7 +45,7 @@ impl IntoView for Icon { <path d="M12.232 4.232a2.5 2.5 0 013.536 3.536l-1.225 1.224a.75.75 0 001.061 1.06l1.224-1.224a4 4 0 00-5.656-5.656l-3 3a4 4 0 00.225 5.865.75.75 0 00.977-1.138 2.5 2.5 0 01-.142-3.667l3-3z"></path> <path d="M11.603 7.963a.75.75 0 00-.977 1.138 2.5 2.5 0 01.142 3.667l-3 3a2.5 2.5 0 01-3.536-3.536l1.225-1.224a.75.75 0 00-1.061-1.06l-1.224 1.224a4 4 0 105.656 5.656l3-3a4 4 0 00-.225-5.865z"></path> </svg> - }.into_view(), + }.into_any(), Self::Calendar => view! { <svg @@ -60,7 +60,7 @@ impl IntoView for Icon { clip-rule="evenodd" ></path> </svg> - }.into_view(), + }.into_any(), Self::Location => view! { <svg @@ -75,7 +75,7 @@ impl IntoView for Icon { clip-rule="evenodd" ></path> </svg> - }.into_view(), + }.into_any(), Icon::Twitter => view! { <svg class=tw_join!("w-6", "h-6", "fill-current", "mr-0", "sm:mr-2") @@ -84,7 +84,7 @@ impl IntoView for Icon { > <path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"></path> </svg> - }.into_view(), + }.into_any(), Icon::Telegram => view! { <svg class=tw_join!("w-6", "h-6", "fill-current", "mr-0", "sm:mr-2") @@ -93,7 +93,7 @@ impl IntoView for Icon { > <path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"></path> </svg> - }.into_view(), + }.into_any(), Icon::Mastodon => view! { <svg class=tw_join!("w-6", "h-6", "fill-current", "mr-0", "sm:mr-2") @@ -102,7 +102,7 @@ impl IntoView for Icon { > <path d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"></path> </svg> - }.into_view(), + }.into_any(), Icon::Github => view! { <svg class=tw_join!("w-6", "h-6", "fill-current", "mr-0", "sm:mr-2") @@ -111,7 +111,7 @@ impl IntoView for Icon { > <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path> </svg> - }.into_view(), + }.into_any(), Icon::Linkedin => view! { <svg class=tw_join!("w-6", "h-6", "fill-current", "mr-0", "sm:mr-2") @@ -120,7 +120,7 @@ impl IntoView for Icon { > <path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"></path> </svg> - }.into_view(), + }.into_any(), Icon::Map => view! { <svg class=tw_join!("w-5", "h-5") @@ -134,7 +134,7 @@ impl IntoView for Icon { clip-rule="evenodd" ></path> </svg> - }.into_view(), + }.into_any(), } } } diff --git a/crates/plcom/src/common/link.rs b/crates/plcom/src/common/link.rs index 2f42e4e..2252084 100644 --- a/crates/plcom/src/common/link.rs +++ b/crates/plcom/src/common/link.rs @@ -1,53 +1,55 @@ -use http::Uri; -use leptos::*; -use tailwind_fuse::tw_join; - -use crate::Icon; +use crate::prelude::*; +use rocket::http::uri::Uri; +use tailwind_fuse::tw_merge; #[derive(Clone, PartialEq)] -pub struct Link { +pub struct Link<'a> { pub label: String, - pub uri: Uri, + pub uri: Uri<'a>, } -impl Link { - pub fn new(uri: &'static str, label: impl Into<String>) -> Self { +impl<'a> Link<'a> { + pub fn new(uri: Uri<'a>, label: impl Into<String>) -> Self { Self { - uri: Uri::from_static(uri), + uri, label: label.into(), } } - pub fn slides(uri: &'static str) -> Self { + pub fn parse(uri: &'static str, label: impl Into<String>) -> Self { + Self { + uri: Uri::parse_any(uri).expect("not a real uri"), + label: label.into(), + } + } + pub fn slides(uri: Uri<'a>) -> Self { Self::new(uri, "Slides") } } -#[component] -pub fn UnderlineLink( - #[prop(into)] link: MaybeSignal<Link>, - #[prop(into, optional)] class: MaybeSignal<String>, - #[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, +pub fn underline_link( + link: Link, + class: Option<String>, ) -> impl IntoView { - let class = tailwind_fuse::tw_merge!("underline", class.get()); + let class = class.unwrap_or_default(); + let class = tw_merge!("underline", class); view! { - <a href=link.get().uri.to_string() {..attributes} class=class target="_blank"> - {link.get().label} + <a href=link.uri.to_string() class=class> + {link.label} </a> } + .into_view() } type HideTextSmallDisplay = bool; -#[component] -pub fn ButtonLink( - #[prop(into)] link: MaybeSignal<Link>, - #[prop(into, optional)] icon: Option<MaybeSignal<Icon>>, - #[prop(into, optional)] hide_text_small_display: Option<MaybeSignal<HideTextSmallDisplay>>, - #[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, -) -> impl IntoView { +pub fn button_link( + link: Link, + icon: Option<Icon>, + hide_text_small_display: Option<HideTextSmallDisplay>, +) -> impl IntoAny { let text_css = hide_text_small_display .and_then(|hide| { - if hide.get() { + if hide { Some(tw_join!("hidden", "sm:inline")) } else { None @@ -55,11 +57,14 @@ pub fn ButtonLink( }) .unwrap_or(tw_join!("ml-2", "sm:ml-0", "text-center")); + let icon = icon + .map(|icon| icon.into_any()) + .unwrap_or_else(|| ().into_any()); + view! { <a - href=link.get().uri.to_string() - {..attributes} - aria-label=link.get().label + href=link.uri.to_string() + aria-label=link.label.to_string() class=tw_join!( "inline-flex", "bg-sky-900", "hover:bg-sky-700", "transition-all", "duration-200", "text-white", "font-bold", "py-2", "px-4", "rounded-xl", "items-center" @@ -68,21 +73,19 @@ pub fn ButtonLink( {icon} <div class=tw_join!("inline-flex", "items-center")> - <span class=text_css>{link.get().label}</span> + <span class=text_css>{link.label.to_string()}</span> </div> </a> } + .into_any() } -#[component] -pub fn OutlineButtonLink( - #[prop(into)] link: MaybeSignal<Link>, - #[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, -) -> impl IntoView { +pub fn outline_button_link( + link: Link, +) -> impl IntoAny { view! { <a - href=link.get().uri.to_string() - {..attributes} + href=link.uri.to_string() class=tw_join!( "mt-4", "inline-flex", "bg-transparent", "hover:bg-sky-700", "text-white", "font-semibold", "py-1.5", "px-4", "rounded-xl", "items-center", "border", @@ -90,10 +93,11 @@ pub fn OutlineButtonLink( ) > - {Icon::Link} + {Icon::Link.into_any()} <div class=tw_join!("inline-flex", "items-center")> - <span class=tw_join!("ml-2", "sm:ml-0", "text-center")>{link.get().label}</span> + <span class=tw_join!("ml-2", "sm:ml-0", "text-center")>{link.label}</span> </div> </a> } + .into_any() } diff --git a/crates/plcom/src/error_template.rs b/crates/plcom/src/error_template.rs deleted file mode 100644 index 14bfc35..0000000 --- a/crates/plcom/src/error_template.rs +++ /dev/null @@ -1,83 +0,0 @@ -use crate::ContentPage; -use http::status::StatusCode; -use leptos::*; -use thiserror::Error; - -#[derive(Clone, Debug, Error)] -pub enum AppError { - #[error("Not Found")] - NotFound, -} - -impl AppError { - pub fn status_code(&self) -> StatusCode { - match self { - AppError::NotFound => StatusCode::NOT_FOUND, - } - } - - pub fn canonical_reason(&self) -> String { - match self { - AppError::NotFound => StatusCode::NOT_FOUND.to_string(), - } - } - - pub fn description(&self) -> String { - match self { - AppError::NotFound => "This page could not be found.".to_string(), - } - } -} - -// A basic function to display errors served by the error boundaries. -// Feel free to do more complicated things here than just displaying the error. -#[component] -pub fn ErrorTemplate( - #[prop(optional)] outside_errors: Option<Errors>, - #[prop(optional)] errors: Option<RwSignal<Errors>>, -) -> impl IntoView { - let errors = match outside_errors { - Some(e) => create_rw_signal(e), - None => match errors { - Some(e) => e, - None => panic!("No Errors found and we expected errors!"), - }, - }; - // Get Errors from Signal - let errors = errors.get_untracked(); - - // Downcast lets us take a type that implements `std::error::Error` - let errors: Vec<AppError> = errors - .into_iter() - .filter_map(|(_k, v)| v.downcast_ref::<AppError>().cloned()) - .collect(); - println!("Errors: {errors:#?}"); - - // Only the response code for the first error is actually sent from the server - // this may be customized by the specific application - #[cfg(feature = "ssr")] - { - use leptos_axum::ResponseOptions; - let response = use_context::<ResponseOptions>(); - if let Some(response) = response { - response.set_status(errors[0].status_code()); - } - } - - view! { - <For - // a function that returns the items we're iterating over; a signal is fine - each=move || { errors.clone().into_iter().enumerate() } - // a unique key for each item as a reference - key=|(index, _error)| *index - // renders each item to a view - children=move |error| { - view! { - <ContentPage title=error.1.canonical_reason()> - <p>{error.1.description()}</p> - </ContentPage> - } - } - /> - } -} diff --git a/crates/plcom/src/fileserv.rs b/crates/plcom/src/fileserv.rs deleted file mode 100644 index e843576..0000000 --- a/crates/plcom/src/fileserv.rs +++ /dev/null @@ -1,42 +0,0 @@ -use axum::{ - body::Body, - extract::State, - response::IntoResponse, - http::{Request, Response, StatusCode, Uri}, -}; -use axum::response::Response as AxumResponse; -use tower::ServiceExt; -use tower_http::services::ServeDir; -use leptos::*; -use crate::app::App; - -pub async fn file_and_error_handler(uri: Uri, State(options): State<LeptosOptions>, req: Request<Body>) -> AxumResponse { - let root = options.site_root.clone(); - let res = get_static_file(uri.clone(), &root).await.unwrap(); - - if res.status() == StatusCode::OK { - res.into_response() - } else { - let handler = leptos_axum::render_app_to_stream(options.to_owned(), App); - handler(req).await.into_response() - } -} - -async fn get_static_file( - uri: Uri, - root: &str, -) -> Result<Response<Body>, (StatusCode, String)> { - let req = Request::builder() - .uri(uri.clone()) - .body(Body::empty()) - .unwrap(); - // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot` - // This path is relative to the cargo root - match ServeDir::new(root).oneshot(req).await { - Ok(res) => Ok(res.into_response()), - Err(err) => Err(( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Something went wrong: {err}"), - )), - } -} diff --git a/crates/plcom/src/lib.rs b/crates/plcom/src/lib.rs deleted file mode 100644 index cd69f0b..0000000 --- a/crates/plcom/src/lib.rs +++ /dev/null @@ -1,45 +0,0 @@ -use leptos::*; -use prelude::*; - -pub mod app; -pub mod common; -pub mod error_template; -#[cfg(feature = "ssr")] -pub mod fileserv; -pub mod pages; - -#[cfg(feature = "hydrate")] -#[wasm_bindgen::prelude::wasm_bindgen] -pub fn hydrate() { - use crate::app::*; - console_error_panic_hook::set_once(); - mount_to_body(App); -} - -pub mod prelude { - pub use super::ContentPage; - pub use crate::common::icon::*; - pub use crate::common::link::*; - pub use crate::common::resume::*; - pub use crate::common::wallpapers::*; - pub use crate::common::*; - pub use leptos::*; - pub use leptos_meta::*; - pub use tailwind_fuse::tw_join; - pub use http::Uri; -} - -#[component] -pub fn ContentPage( - #[prop(into, optional)] title: MaybeSignal<String>, - children: Children, -) -> impl IntoView { - view! { - <leptos_meta::Title text=title.get()></leptos_meta::Title> - <div class=tw_join!("container", "mx-auto", "px-4", "py-16")> - <h1 class=tw_join!("text-3xl", "sm:text-4xl", "font-bold")>{title}</h1> - <UnderlineLink link=Link::new("/", "← Home")/> - <div class=tw_join!("mt-8")>{children()}</div> - </div> - } -} diff --git a/crates/plcom/src/main.rs b/crates/plcom/src/main.rs index d084ee4..dfb7d6c 100644 --- a/crates/plcom/src/main.rs +++ b/crates/plcom/src/main.rs @@ -1,38 +1,44 @@ -#[cfg(feature = "ssr")] -#[tokio::main] -async fn main() { - use axum::Router; - use leptos::*; - use leptos_axum::{generate_route_list, LeptosRoutes}; - use plcom::app::*; - use plcom::fileserv::file_and_error_handler; - - // Setting get_configuration(None) means we'll be using cargo-leptos's env values - // For deployment these variables are: - // <https://github.com/leptos-rs/start-axum#executing-a-server-on-a-remote-machine-without-the-toolchain> - // Alternately a file can be specified such as Some("Cargo.toml") - // The file would need to be included with the executable when moved to deployment - let conf = get_configuration(None).await.unwrap(); - let leptos_options = conf.leptos_options; - let addr = leptos_options.site_addr; - let routes = generate_route_list(App); - - // build our application with a route - let app = Router::new() - .leptos_routes(&leptos_options, routes, App) - .fallback(file_and_error_handler) - .with_state(leptos_options); - - let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); - logging::log!("listening on http://{}", &addr); - axum::serve(listener, app.into_make_service()) - .await - .unwrap(); +mod prelude { + pub use crate::common::icon::Icon; + pub use crate::common::link::*; + pub use crate::common::Date; + pub use crate::views::*; + pub use leptos::prelude::*; + pub use rocket::uri; + pub use tailwind_fuse::tw_join; } -#[cfg(not(feature = "ssr"))] -pub fn main() { - // no client-side main function - // unless we want this to work with e.g., Trunk for a purely client-side app - // see lib.rs for hydration function instead +mod cache; +mod common; +mod pages; +mod views; + +use pages::*; + +#[rocket::launch] +fn rocket() -> _ { + let server = rocket::build() + .mount("/", rocket::fs::FileServer::from("public")) + .mount( + "/", + rocket::routes![root_route, email_route, wallpapers_route], + ) + .register("/", rocket::catchers![not_found]); + + if cfg!(debug_assertions) { + server + } else { + server + .attach( + rocket_async_compression::CachedCompression::path_suffix_fairing(vec![ + // Code + ".js".into(), + ".css".into(), + // Documents + ".pdf".into(), + ".txt".into(), + ]), + ) + .attach(cache::CacheControl::default()) + } } diff --git a/crates/plcom/src/pages.rs b/crates/plcom/src/pages.rs index 94a291f..2d554b3 100644 --- a/crates/plcom/src/pages.rs +++ b/crates/plcom/src/pages.rs @@ -1,7 +1,47 @@ -pub mod root; -pub mod email; -pub mod wallpapers; +mod email; +mod root; +mod wallpapers; -pub use root::RootPage; -pub use email::EmailPage; -pub use wallpapers::WallpapersPage; +use crate::common::wallpapers::Wallpaper; +use crate::prelude::*; +use rocket::get; + +#[derive(rocket::Responder)] +#[response(content_type = "text/html")] +pub struct LeptosResponder(String); + +impl From<AnyView> for LeptosResponder { + fn from(value: AnyView) -> Self { + Self(value.to_html()) + } +} + +#[rocket::catch(404)] +pub fn not_found() -> LeptosResponder { + content_page( + "404 Not Found", + view! { + <div>"This page could not be found."</div> + }, + ) + .into() +} + +#[get("/?<wallpaper>")] +pub fn root_route(wallpaper: Option<&str>) -> LeptosResponder { + let wallpaper = wallpaper + .and_then(Wallpaper::find) + .or_else(Wallpaper::random); + + shell("Philippe Loctaux", root::root_page(wallpaper)).into() +} + +#[get("/email")] +pub fn email_route() -> LeptosResponder { + content_page("Email", email::email_page()).into() +} + +#[get("/wallpapers")] +pub fn wallpapers_route() -> LeptosResponder { + content_page("Wallpapers", wallpapers::wallpapers_page()).into() +} diff --git a/crates/plcom/src/pages/email.rs b/crates/plcom/src/pages/email.rs index 1c65814..7b6bd1f 100644 --- a/crates/plcom/src/pages/email.rs +++ b/crates/plcom/src/pages/email.rs @@ -1,37 +1,29 @@ use crate::prelude::*; -#[component] -pub fn EmailPage() -> impl IntoView { +pub fn email_page() -> impl IntoAny { view! { - <ContentPage title="Email"> - <p> - "Send an email if you want to work with me, propose a project idea, or just to say hi!" - </p> - <div class=tw_join!("my-4")> - <ButtonLink - link=Link::new( - "mailto:wwwATphilippeloctaux~DOT~com", - "www at philippeloctaux dot com", - ) + <p> + "Send an email if you want to work with me, propose a project idea, or just to say hi!" + </p> + <div class=tw_join!("my-4")> + {button_link(Link::new( + uri!("mailto:wwwATphilippeloctaux~DOT~com").into(), + "www at philippeloctaux dot com", + ), Some(Icon::Email), None).into_any()} + </div> - icon=Icon::Email - /> - </div> - - <p class=tw_join!( - "mb-2" - )> - "If you want to encrypt your message, I have a " - <UnderlineLink link=Link::new("/pub/pgp-0x69771CD04BA82EC0.txt", "pgp key")/> - " at your disposal." - </p> - <p class=tw_join!( - "mb-2" - )> - "I also have a " <UnderlineLink link=Link::new("/keybase.txt", "Keybase")/> - " account, but I do not check it often." - </p> - </ContentPage> - } + <p class=tw_join!( + "mb-2" + )> + "If you want to encrypt your message, I have a " + {underline_link(Link::new(uri!("/pub/pgp-0x69771CD04BA82EC0.txt").into(), "pgp key"), None).into_any()} + " at your disposal." + </p> + <p class=tw_join!( + "mb-2" + )> + "I also have a "{underline_link(Link::new(uri!("/keybase.txt").into(), "Keybase"), None).into_any()} + " account, but I do not check it often." + </p> + }.into_any() } - diff --git a/crates/plcom/src/pages/root.rs b/crates/plcom/src/pages/root.rs index 48d008e..efe95c5 100644 --- a/crates/plcom/src/pages/root.rs +++ b/crates/plcom/src/pages/root.rs @@ -1,38 +1,35 @@ -use crate::prelude::*; - -mod hero; -mod www; +mod education; mod experience; +mod friends; +mod hero; mod jobs; mod projects; -mod education; mod talks; -mod friends; +mod www; -#[component] -pub fn RootPage() -> impl IntoView { - let random_wallpaper = Wallpaper::random(); +use crate::common::wallpapers::Wallpaper; +use crate::prelude::*; +pub fn root_page(wallpaper: Option<&'static Wallpaper>) -> impl IntoAny { view! { - <Title text="Hello"/> - <hero::Hero wallpaper=random_wallpaper></hero::Hero> + {hero::hero(wallpaper).into_any()} <div class=tw_join!("container", "mx-auto", "px-4", "md:px-8", "lg:px-16", "py-16")> - <Whoami/> + {whoami} <div class=tw_join!("my-16", "space-y-16", "md:space-y-32")> - <www::Www></www::Www> - <jobs::Jobs></jobs::Jobs> - <projects::Projects></projects::Projects> - <education::EducationList></education::EducationList> - <talks::Talks></talks::Talks> - <friends::Friends></friends::Friends> + {www::list().into_any()} + {jobs::jobs().into_any()} + {projects::projects().into_any()} + {education::education_list().into_any()} + {talks::talks().into_any()} + {friends::friends().into_any()} </div> </div> } + .into_any() } -#[component] -fn Whoami() -> impl IntoView { +fn whoami() -> impl IntoView { view! { <div class=tw_join!("md:flex", "md:flex-row-reverse", "items-center")> <div class=tw_join!("md:w-1/2", "mb-4", "md:mb-0")> diff --git a/crates/plcom/src/pages/root/education.rs b/crates/plcom/src/pages/root/education.rs index 223b80b..2f2ee59 100644 --- a/crates/plcom/src/pages/root/education.rs +++ b/crates/plcom/src/pages/root/education.rs @@ -1,8 +1,9 @@ -use crate::prelude::*; use super::experience::*; +use crate::common::resume::{self, Education}; +use crate::prelude::*; -impl IntoView for Education { - fn into_view(self) -> View { +impl IntoAny for Education { + fn into_any(self) -> AnyView { let subtitle = format!("{} in {}", self.study_type, self.area); view! { <div class=tw_join!( @@ -15,7 +16,7 @@ impl IntoView for Education { self.institution, &subtitle, self.logo.as_ref(), - )} + ).into_any()} <div class=tw_join!("space-y-2")> <ul class=tw_join!( "list-disc", "mt-6" @@ -31,12 +32,12 @@ impl IntoView for Education { </div> </div> - }.into_view() + } + .into_any() } } -#[component] -pub fn EducationList() -> impl IntoView { +pub fn education_list() -> impl IntoView { view! { <div> @@ -44,8 +45,7 @@ pub fn EducationList() -> impl IntoView { <div class=tw_join!( "mt-4", "grid", "grid-cols-1", "md:grid-cols-2", "gap-6", "place-content-center" - )>{resume::EDUCATION.collect_view()}</div> + )>{resume::EDUCATION.map(|education| education.into_any()).collect_view()}</div> </div> } } - diff --git a/crates/plcom/src/pages/root/experience.rs b/crates/plcom/src/pages/root/experience.rs index 5b76f83..559e02f 100644 --- a/crates/plcom/src/pages/root/experience.rs +++ b/crates/plcom/src/pages/root/experience.rs @@ -1,7 +1,6 @@ -use tailwind_fuse::*; -use leptos::*; -use crate::common::Date; use crate::common::resume::Logo; +use crate::prelude::*; +use tailwind_fuse::*; #[derive(TwClass, Clone, Copy, PartialEq)] #[tw(class = r#"h-16 w-16 rounded-xl"#)] @@ -17,24 +16,17 @@ enum ImageBackground { Plain, } -#[component] -fn ExperienceLogo( - #[prop(into)] image: MaybeSignal<String>, - /// Name of the experience, used in the alt of the image - #[prop(into)] - name: MaybeSignal<String>, - #[prop(into, optional)] background: MaybeSignal<ImageBackground>, - #[prop(into, optional)] class: MaybeSignal<String>, - #[prop(attrs)] attributes: Vec<(&'static str, Attribute)>, +fn experience_logo( + image: String, + // Name of the experience, used in the alt of the image + name: String, + background: ImageBackground, + class: String, ) -> impl IntoView { - let class = create_memo(move |_| { - let background = background.get(); - let logo = LogoOptions { background }; - logo.with_class(class.get()) - }); - let alt = format!("{} logo", name.get()); + let class = LogoOptions { background }.with_class(class); + let alt = format!("{} logo", name); - view! { <img {..attributes} loading="lazy" src=image.get() alt=alt class=class/> } + view! { <img loading="lazy" src=image alt=alt class=class/> } } struct ExperienceLogo { @@ -50,19 +42,17 @@ pub struct ExperienceHeader { logo: Option<ExperienceLogo>, } -impl IntoView for ExperienceHeader { - fn into_view(self) -> View { +impl IntoAny for ExperienceHeader { + fn into_any(self) -> AnyView { let logo = match self.logo { - Some(logo) => view! { - <ExperienceLogo - image=logo.file - name=self.name.clone() - background=logo.options.map(|o| o.background).unwrap_or_default() - class=tw_join!("mr-4") - /> - } - .into_view(), - None => view! {}.into_view(), + Some(logo) => experience_logo( + logo.file, + self.name.clone(), + logo.options.map(|o| o.background).unwrap_or_default(), + tw_join!("mr-4"), + ) + .into_any(), + None => ().into_any(), }; let date = match self.date_end { @@ -87,7 +77,7 @@ impl IntoView for ExperienceHeader { )>{self.description}</p> </div> } - .into_view() + .into_any() } } diff --git a/crates/plcom/src/pages/root/friends.rs b/crates/plcom/src/pages/root/friends.rs index e6504f6..682cefd 100644 --- a/crates/plcom/src/pages/root/friends.rs +++ b/crates/plcom/src/pages/root/friends.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use rocket::http::uri::Absolute; #[derive(Clone, PartialEq)] struct Name { @@ -51,21 +52,21 @@ impl std::fmt::Display for Name { #[derive(Clone, PartialEq)] struct Friend { name: Name, - uri: Uri, + uri: Absolute<'static>, } impl Friend { - pub fn nick(nick: impl Into<String>, uri: &'static str) -> Self { + pub fn nick(nick: impl Into<String>, uri: Absolute<'static>) -> Self { Self { name: Name::nick(nick), - uri: Uri::from_static(uri), + uri, } } - pub fn new(first: impl Into<String>, last: impl Into<String>, uri: &'static str) -> Self { + pub fn new(first: impl Into<String>, last: impl Into<String>, uri: Absolute<'static>) -> Self { Self { name: Name::new(first, last), - uri: Uri::from_static(uri), + uri, } } @@ -77,45 +78,45 @@ impl Friend { } } -#[component] -fn Friend(#[prop(into)] friend: MaybeSignal<Friend>) -> impl IntoView { - view! { - <a - href=friend.get().uri.to_string() - target="_blank" +impl IntoAny for Friend { + fn into_any(self) -> AnyView { + view! { + <a + href=self.uri.to_string() class=tw_join!( "hover:bg-gray-500", "transition-all", "duration-200", "flex", "items-center", "rounded-lg", "p-2" ) - > + > <span class=tw_join!( "rounded-full", "flex-shrink-0", "mr-4", "w-10", "h-10", "bg-sky-900", "text-white", "flex", "items-center", "justify-center", "text-lg", "font-medium" - )>{friend.get().name.initials()}</span> + )>{self.name.initials()}</span> <div> - <p class=tw_join!("font-bold")>{friend.get().name.to_string()}</p> - <p>{friend.get().domain_name()}</p> - </div> - </a> + <p class=tw_join!("font-bold")>{self.name.to_string()}</p> + <p>{self.domain_name()}</p> + </div> + </a> + } + .into_any() } } -#[component] -pub fn Friends() -> impl IntoView { +pub fn friends() -> impl IntoView { let friends = [ - Friend::new("Paolo", "Rotolo", "https://rotolo.dev"), - Friend::new("Polly", "Bishop", "https://github.com/itspolly"), - Friend::new("Ayden", "Panhuyzen", "https://ayden.dev"), - Friend::new("Corbin", "Crutchley", "https://crutchcorn.dev"), - Friend::new("James", "Fenn", "https://jfenn.me"), - Friend::new("Alex", "Dueppen", "https://ajd.sh"), - Friend::new("Lyra", "Messier", "https://lyramsr.co"), - Friend::new("Peter", "Soboyejo", "https://twitter.com/pxtvr"), - Friend::nick("Millomaker", "https://youtube.com/millomaker"), - Friend::new("Alexandre", "Wagner", "https://dev4people.fr"), - Friend::new("Aidan", "Follestad", "https://af.codes"), - Friend::new("Victor", "Simon", "https://simonvictor.com"), + Friend::new("Paolo", "Rotolo", uri!("https://rotolo.dev")), + Friend::new("Polly", "Bishop", uri!("https://github.com/itspolly")), + Friend::new("Ayden", "Panhuyzen", uri!("https://ayden.dev")), + Friend::new("Corbin", "Crutchley", uri!("https://crutchcorn.dev")), + Friend::new("James", "Fenn", uri!("https://jfenn.me")), + Friend::new("Alex", "Dueppen", uri!("https://ajd.sh")), + Friend::new("Lyra", "Messier", uri!("https://lyramsr.co")), + Friend::new("Peter", "Soboyejo", uri!("https://twitter.com/pxtvr")), + Friend::nick("Millomaker", uri!("https://youtube.com/millomaker")), + Friend::new("Alexandre", "Wagner", uri!("https://dev4people.fr")), + Friend::new("Aidan", "Follestad", uri!("https://af.codes")), + Friend::new("Victor", "Simon", uri!("https://simonvictor.com")), ]; view! { @@ -129,10 +130,10 @@ pub fn Friends() -> impl IntoView { )> {friends .into_iter() - .map(|f| { + .map(|friend| { view! { <li class=tw_join!("py-2")> - <Friend friend=f/> + {friend.into_any()} </li> } }) diff --git a/crates/plcom/src/pages/root/hero.rs b/crates/plcom/src/pages/root/hero.rs index 93b2b91..2c8e665 100644 --- a/crates/plcom/src/pages/root/hero.rs +++ b/crates/plcom/src/pages/root/hero.rs @@ -1,7 +1,7 @@ +use crate::common::wallpapers::Wallpaper; use crate::prelude::*; -#[component] -fn WallpaperInfo(#[prop(into)] wallpaper: &'static Wallpaper) -> impl IntoView { +fn wallpaper_info(wallpaper: &'static Wallpaper) -> impl IntoAny { view! { <div class=tw_join!( "absolute", "bottom-3", "sm:bottom-5", "left-2", "sm:left-5", "inline-block", @@ -14,11 +14,10 @@ fn WallpaperInfo(#[prop(into)] wallpaper: &'static Wallpaper) -> impl IntoView { <div class=tw_join!( "inline-flex", "items-center" )> - {Icon::Map} + {Icon::Map.into_any()} <a class=tw_join!("ml-1", "text-sm", "underline") href="/wallpapers" - target="_blank" > "See more!" </a> @@ -30,7 +29,7 @@ fn WallpaperInfo(#[prop(into)] wallpaper: &'static Wallpaper) -> impl IntoView { <div class=tw_join!( "inline-flex", "items-center" )> - {Icon::Location} + {Icon::Location.into_any()} <span class=tw_join!( "ml-1", "text-sm" )> @@ -47,22 +46,21 @@ fn WallpaperInfo(#[prop(into)] wallpaper: &'static Wallpaper) -> impl IntoView { <div class=tw_join!( "inline-flex", "items-center" )> - {Icon::Calendar} <span class=tw_join!("ml-1", "text-sm")>{wallpaper.date}</span> + {Icon::Calendar.into_any()} <span class=tw_join!("ml-1", "text-sm")>{wallpaper.date}</span> </div> </div> </div> - } + }.into_any() } -#[component] -pub fn Hero(#[prop(into)] wallpaper: Option<&'static Wallpaper>) -> impl IntoView { +pub fn hero(wallpaper: Option<&'static Wallpaper>) -> impl IntoAny { let (wallpaper_info, background_image) = match wallpaper { Some(wallpaper) => ( - view! { <WallpaperInfo wallpaper=wallpaper/> }.into_view(), + wallpaper_info(wallpaper).into_any(), format!("background-image: url(/wallpapers/{});", wallpaper.filename), ), - None => (view! {}.into_view(), "".into()), + None => (().into_any(), "".to_string()), }; view! { diff --git a/crates/plcom/src/pages/root/jobs.rs b/crates/plcom/src/pages/root/jobs.rs index 2275b40..3c4b304 100644 --- a/crates/plcom/src/pages/root/jobs.rs +++ b/crates/plcom/src/pages/root/jobs.rs @@ -1,8 +1,14 @@ -use crate::prelude::*; use super::experience::*; +use crate::common::resume::{self, Work}; +use crate::prelude::*; + +impl IntoAny for Work { + fn into_any(self) -> AnyView { + let link = match self.link { + Some(link) => link.into_any(), + None => ().into_any(), + }; -impl IntoView for Work { - fn into_view(self) -> View { view! { <div class=tw_join!("w-full", "rounded-2xl", "bg-sky-950")> @@ -16,7 +22,7 @@ impl IntoView for Work { self.name, self.position, Some(&self.logo), - )} <div class=tw_join!("space-y-2")> + ).into_any()} <div class=tw_join!("space-y-2")> <p>{self.description}</p> @@ -53,24 +59,22 @@ impl IntoView for Work { </div> </div> - </div> {self.link} + </div> {link} </div> </div> - }.into_view() + }.into_any() } } -#[component] -pub fn Jobs() -> impl IntoView { +pub fn jobs() -> impl IntoView { view! { <div> <h1 class=tw_join!("text-4xl", "font-bold", "mb-4")>"Professional Experiences"</h1> <div class=tw_join!( "mt-4", "grid", "grid-cols-1", "sm:grid-cols-2", "gap-4" - )>{resume::WORK.collect_view()}</div> + )>{resume::WORK.map(|work| work.into_any()).collect_view()}</div> </div> } } - diff --git a/crates/plcom/src/pages/root/projects.rs b/crates/plcom/src/pages/root/projects.rs index 1bcc3fe..343cf16 100644 --- a/crates/plcom/src/pages/root/projects.rs +++ b/crates/plcom/src/pages/root/projects.rs @@ -1,8 +1,9 @@ -use crate::prelude::*; use super::experience::*; +use crate::common::resume::{self, Project}; +use crate::prelude::*; -impl IntoView for Project { - fn into_view(self) -> View { +impl IntoAny for Project { + fn into_any(self) -> AnyView { let (css_image_position, css_image_position_corner) = match self.image { Some(image) => { let position = match image.position { @@ -33,6 +34,11 @@ impl IntoView for Project { None => ("".into(), "".into()), }; + let link = match self.link { + Some(link) => link.into_any(), + None => ().into_any(), + }; + view! { <div class=tw_join!( "w-full", "rounded-2xl", "bg-pink-950", css_image_position @@ -47,9 +53,9 @@ impl IntoView for Project { class=css_image_position_corner /> } - .into_view() + .into_any() } else { - view! {}.into_view() + ().into_any() }} <div class=tw_join!( "p-6", "justify-between", "h-full" @@ -61,7 +67,7 @@ impl IntoView for Project { self.name, self.description, self.logo.as_ref(), - )} + ).into_any()} <div class=tw_join!( "space-y-2" )> @@ -70,7 +76,7 @@ impl IntoView for Project { .presentation .iter() .map(|p| { - view! { <p>{*p}</p> } + view! { <p>{*p}</p> }.into_any() }) .collect_view()} <div> <ul class=tw_join!( @@ -80,7 +86,7 @@ impl IntoView for Project { .highlights .iter() .map(|h| { - view! { <li class=tw_join!("ml-5")>{*h}</li> } + view! { <li class=tw_join!("ml-5")>{*h}</li> }.into_any() }) .collect_view()} </ul> @@ -99,47 +105,51 @@ impl IntoView for Project { "items-center", "rounded-md", "bg-blue-100", "px-2", "py-1", "font-medium", "text-blue-700", )>{*t}</span> - } + }.into_any() }) .collect_view()} </div> </div> - </div> {self.link} + </div> {link} </div> </div> - }.into_view() + }.into_any() } } - type ImageProject = Project; - type TextProject = Project; +type ImageProject = Project; +type TextProject = Project; - enum DisplayProject { - Text(Box<(TextProject, Option<TextProject>)>), - Image(ImageProject) - } +enum DisplayProject { + Text(Box<(TextProject, Option<TextProject>)>), + Image(ImageProject), +} -impl IntoView for DisplayProject { - fn into_view(self) -> View { +impl IntoAny for DisplayProject { + fn into_any(self) -> AnyView { match self { - Self::Image(image) => image.into_view(), + Self::Image(image) => image.into_any(), Self::Text(boxy) => { let (text1, text2) = *boxy; - view! { - <div class=tw_join!( - "my-4", "grid", "grid-cols-1", "sm:grid-cols-2", "gap-4" - )>{text1} {text2}</div> - }.into_view() - + let text2 = match text2 { + Some(text2) => text2.into_any(), + None => ().into_any(), + }; + view! { + <div class=tw_join!( + "my-4", "grid", "grid-cols-1", "sm:grid-cols-2", "gap-4" + )>{text1.into_any()} {text2}</div> + } + .into_any() } + .into_any(), } } } -#[component] -pub fn Projects() -> impl IntoView { +pub fn projects() -> impl IntoView { let mut projects = vec![]; let mut iter = resume::PROJECTS.iter(); @@ -148,7 +158,10 @@ pub fn Projects() -> impl IntoView { projects.push(DisplayProject::Image(*cur_proj)); } else { let next_text = iter.next(); - projects.push(DisplayProject::Text(Box::new((*cur_proj, next_text.copied())))); + projects.push(DisplayProject::Text(Box::new(( + *cur_proj, + next_text.copied(), + )))); } } @@ -157,7 +170,7 @@ pub fn Projects() -> impl IntoView { <h1 class=tw_join!("text-4xl", "font-bold", "mb-4")>"Projects"</h1> - {projects} + {projects.into_iter().map(|project| project.into_any()).collect_view()} </div> } } diff --git a/crates/plcom/src/pages/root/talks.rs b/crates/plcom/src/pages/root/talks.rs index a1b46b9..35a02e0 100644 --- a/crates/plcom/src/pages/root/talks.rs +++ b/crates/plcom/src/pages/root/talks.rs @@ -5,7 +5,7 @@ struct Talk { title: String, date: Date, location: String, - link: Link, + link: Link<'static>, } impl Talk { @@ -13,7 +13,7 @@ impl Talk { title: impl Into<String>, date: Date, location: impl Into<String>, - link: Link, + link: Link<'static>, ) -> Self { Self { title: title.into(), @@ -24,35 +24,35 @@ impl Talk { } } -#[component] -fn Talk(#[prop(into)] talk: MaybeSignal<Talk>) -> impl IntoView { - view! { +impl IntoAny for Talk { + fn into_any(self) -> AnyView { + view! { <div class=tw_join!("rounded-2xl", "w-full", "bg-teal-950", "p-6")> - <div class=tw_join!("text-xl", "font-semibold", "mb-4")>{talk.get().title}</div> + <div class=tw_join!("text-xl", "font-semibold", "mb-4")>{self.title}</div> <div class=tw_join!("flex")> <div class=tw_join!( "inline-flex", "items-center" )> - {Icon::Calendar} - <span class=tw_join!("ml-2")>{talk.get().date.to_string()}</span> + {Icon::Calendar.into_any()} + <span class=tw_join!("ml-2")>{self.date.to_string()}</span> </div> </div> <div class=tw_join!("flex")> <div class=tw_join!( "inline-flex", "items-center" - )>{Icon::Location} <span class=tw_join!("ml-2")>{talk.get().location}</span></div> + )>{Icon::Location.into_any()} <span class=tw_join!("ml-2")>{self.location}</span></div> </div> - <OutlineButtonLink link=talk.get().link/> + {outline_button_link(self.link).into_any()} </div> + }.into_any() } } -#[component] -pub fn Talks() -> impl IntoView { +pub fn talks() -> impl IntoAny { let talks = [ Talk::new( "Vim", @@ -61,7 +61,7 @@ pub fn Talks() -> impl IntoView { month: 2, }, "Epitech Rennes", - Link::slides("/pub/talks/vim.pdf"), + Link::slides(uri!("/pub/talks/vim.pdf").into()), ), Talk::new( "CLion", @@ -70,7 +70,7 @@ pub fn Talks() -> impl IntoView { month: 3, }, "Epitech Rennes", - Link::slides("/pub/talks/clion.pdf"), + Link::slides(uri!("/pub/talks/clion.pdf").into()), ), Talk::new( "git & devops 2", @@ -79,7 +79,7 @@ pub fn Talks() -> impl IntoView { month: 2, }, "Epitech Rennes", - Link::slides("/pub/talks/git-devops2.pdf"), + Link::slides(uri!("/pub/talks/git-devops2.pdf").into()), ), Talk::new( "pass4thewin", @@ -88,7 +88,7 @@ pub fn Talks() -> impl IntoView { month: 2, }, "Epitech Rennes", - Link::slides("/pub/talks/pass4thewin.pdf"), + Link::slides(uri!("/pub/talks/pass4thewin.pdf").into()), ), Talk::new( "git & devops", @@ -97,7 +97,7 @@ pub fn Talks() -> impl IntoView { month: 5, }, "Epitech Rennes", - Link::slides("/pub/talks/git-devops.pdf"), + Link::slides(uri!("/pub/talks/git-devops.pdf").into()), ), Talk::new( "git gud", @@ -106,7 +106,7 @@ pub fn Talks() -> impl IntoView { month: 5, }, "Epitech Rennes", - Link::slides("/pub/talks/git-tek.pdf"), + Link::slides(uri!("/pub/talks/git-tek.pdf").into()), ), ]; @@ -123,15 +123,9 @@ pub fn Talks() -> impl IntoView { "mt-4", "grid", "grid-cols-1", "sm:grid-cols-2", "lg:grid-cols-3", "gap-6", "place-content-center" )> - {talks - .into_iter() - .map(|t| { - view! { <Talk talk=t/> } - }) - .collect_view()} + {talks.into_iter().map(|talk| talk.into_any()).collect_view()} </div> </div> } } - diff --git a/crates/plcom/src/pages/root/www.rs b/crates/plcom/src/pages/root/www.rs index 4931367..dcf391a 100644 --- a/crates/plcom/src/pages/root/www.rs +++ b/crates/plcom/src/pages/root/www.rs @@ -1,36 +1,54 @@ use crate::prelude::*; #[derive(Clone, PartialEq)] -struct Www { - link: Link, +pub struct Www { + link: Link<'static>, icon: Icon, } -#[component] -pub fn Www() -> impl IntoView { +impl IntoAny for Www { + fn into_any(self) -> AnyView { + view! { + <div class=tw_join!("w-full", "h-auto", "md:w-auto")> + <div class=tw_join!("text-center")> + {button_link(self.link, Some(self.icon), Some(true)).into_any()} + </div> + </div> + } + .into_any() + } +} + +pub fn list() -> impl IntoAny { let www = [ Www { - link: Link::new("https://twitter.com/philippeloctaux", "Twitter"), + link: Link::new( + uri!("https://twitter.com/philippeloctaux").into(), + "Twitter", + ), icon: Icon::Twitter, }, Www { - link: Link::new("https://t.me/philippeloctaux", "Telegram"), + link: Link::new(uri!("https://t.me/philippeloctaux").into(), "Telegram"), icon: Icon::Telegram, }, Www { - link: Link::new("https://mastodon.social/@philt3r", "Mastodon"), + link: Link::new(uri!("https://mastodon.social/@philt3r").into(), "Mastodon"), icon: Icon::Mastodon, }, Www { - link: Link::new("https://github.com/deadbaed", "GitHub"), + link: Link::new(uri!("https://github.com/deadbaed").into(), "GitHub"), icon: Icon::Github, }, Www { - link: Link::new("https://linkedin.com/in/philippeloctaux", "LinkedIn"), + link: Link::new( + uri!("https://linkedin.com/in/philippeloctaux").into(), + "LinkedIn", + ), icon: Icon::Linkedin, }, Www { - link: Link::new("/email", "Email"), + link: Link::new(uri!("/email").into(), "Email"), icon: Icon::Email, }, ]; @@ -39,27 +57,9 @@ pub fn Www() -> impl IntoView { "grid", "grid-cols-3", "lg:grid-cols-6", "gap-4", "place-content-center" )> - {www - .into_iter() - .map(|w| { - view! { - <div class=tw_join!("w-full", "h-auto", "md:w-auto")> - <div class=tw_join!("text-center")> - <ButtonLink - link=w.link - icon=w.icon - hide_text_small_display=true - attributes=vec![ - ("target", Attribute::String(Oco::Borrowed("_blank"))), - ] - /> - - </div> - </div> - } - }) - .collect_view()} + {www.into_iter().map(|w| {w.into_any()}).collect_view()} </div> } + .into_any() } diff --git a/crates/plcom/src/pages/wallpapers.rs b/crates/plcom/src/pages/wallpapers.rs index c5dba14..8a1b613 100644 --- a/crates/plcom/src/pages/wallpapers.rs +++ b/crates/plcom/src/pages/wallpapers.rs @@ -1,49 +1,37 @@ +use crate::common::wallpapers::WALLPAPERS; use crate::prelude::*; -#[component] -pub fn WallpapersPage() -> impl IntoView { - use leptos_leaflet::{TileLayer, MapContainer, Position, Marker, position, Popup}; - - let wallpapers = WALLPAPERS; +pub fn wallpapers_page() -> impl IntoAny { + let wallpaper_markers = WALLPAPERS + .iter() + .map(|wallpaper| { + format!( + r#"L.marker({}).addTo(map).bindPopup(`<p>{}<br>{}<br><b>{}</b></p><a href="/?wallpaper={}">Use as wallpaper</a>`);"#, + wallpaper.gps, + wallpaper.location.precise, + wallpaper.location.broad, + wallpaper.date, + wallpaper.filename, + ) + }) + .collect::<Vec<String>>() + .join("\n"); view! { - <ContentPage title="Wallpapers"> - <Stylesheet href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"/> - <Script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"/> - <p class=tw_join!("mb-2")>"Pictures I took around the world"</p> - <MapContainer - center=Position::new(0.0, 0.0) - zoom=1.0 - class=tw_join!("w-full", "h-halfscreen") - > - <TileLayer - url="https://tile.openstreetmap.org/{z}/{x}/{y}.png" - attribution="© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors" - /> - <For - each=move || wallpapers - key=|w| w.filename - children=move |w: Wallpaper| { - let uri = format!("/wallpapers/{}", w.filename); - view! { - <Marker position=position!( - w.gps.latitude.into(), w.gps.longitude.into() - )> - <Popup> - <a target="_blank" href=uri> - {w.location.precise} - </a> - <br/> - {w.location.broad} - <br/> - <b>{w.date}</b> - </Popup> - </Marker> - } - } - /> + <p class=tw_join!("mb-2")>"Pictures I took around the world"</p> - </MapContainer> - </ContentPage> - } + <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/> + <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script> + <div id="map" class="w-full h-halfscreen"></div> + + <script inner_html=r#" + let map = L.map('map').setView([48.858288, 2.294442], 2); + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 19, + attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' + }).addTo(map); + "#></script> + + <script inner_html=wallpaper_markers></script> + }.into_any() } diff --git a/crates/plcom/src/views.rs b/crates/plcom/src/views.rs new file mode 100644 index 0000000..c886d1b --- /dev/null +++ b/crates/plcom/src/views.rs @@ -0,0 +1,63 @@ +use crate::prelude::*; + +pub fn shell(title: &str, children: impl IntoAny) -> AnyView { + const SUFFIX: &str = "Philippe Loctaux"; + let title = if title != SUFFIX { + format!("{title} - {SUFFIX}") + } else { + title.into() + }; + + let year = jiff::Zoned::now().year(); + view! { + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="utf-8"/> + <meta name="viewport" content="width=device-width"/> + <link rel="stylesheet" href="/style.css" /> + <title>{title} + + // favicon + + + + + + + + + + +
+ {children.into_any()} +
+ + + + + }.into_any() +} + +pub fn content_page(title: &str, children: impl IntoAny) -> AnyView { + shell( + title, + view! { +
+

{title.to_string()}

+ {underline_link(Link::new(uri!("/").into(), "← Home"), None).into_any()} +
{children.into_any()}
+
+ } + .into_any(), + ) + .into_any() +}