From f80dd97a86a2e69f24c3806208342ece6bcec4c3 Mon Sep 17 00:00:00 2001 From: Sameer Puri Date: Mon, 5 Feb 2024 12:41:00 -0500 Subject: [PATCH] Revert "update CLI and web" This reverts commit de33bfbd39a8334e2bfea2ca9d57b0269f511f8a. --- Cargo.lock | 365 +++++++++++++++++++++------------------ cli/Cargo.toml | 2 +- lib/src/converter/mod.rs | 5 +- lib/src/turtle/g_code.rs | 9 +- web/Cargo.toml | 4 +- web/src/forms/mod.rs | 28 ++- web/src/main.rs | 197 ++++++++++----------- web/src/ui/mod.rs | 2 +- 8 files changed, 320 insertions(+), 292 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4abbec4..5c04335 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,6 +55,17 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "atty" version = "0.2.14" @@ -89,9 +100,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bincode" @@ -110,9 +121,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -134,9 +145,9 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "borsh" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" dependencies = [ "borsh-derive", "cfg_aliases", @@ -144,15 +155,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" dependencies = [ "once_cell", - "proc-macro-crate 3.1.0", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", "syn_derive", ] @@ -198,11 +209,11 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cairo-rs" -version = "0.18.5" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.1", "cairo-sys-rs", "libc", "once_cell", @@ -230,9 +241,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.6" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", "target-lexicon", @@ -305,15 +316,18 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] [[package]] name = "darling" -version = "0.20.5" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ "darling_core", "darling_macro", @@ -321,27 +335,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.5" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -385,9 +399,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -400,9 +414,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -414,9 +428,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -424,44 +438,44 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -491,9 +505,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -504,9 +518,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gloo" @@ -537,7 +551,7 @@ dependencies = [ "gloo-dialogs 0.2.0", "gloo-events 0.2.0", "gloo-file 0.3.0", - "gloo-history 0.2.2", + "gloo-history 0.2.1", "gloo-net 0.4.0", "gloo-render 0.2.0", "gloo-storage 0.3.0", @@ -655,15 +669,15 @@ dependencies = [ [[package]] name = "gloo-history" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903f432be5ba34427eac5e16048ef65604a82061fe93789f2212afc73d8617d6" +checksum = "0c4022e82f5f9e03cb1251b13c0a967e0600e97aa179c617f6519bac40640160" dependencies = [ "getrandom", "gloo-events 0.2.0", "gloo-utils 0.2.0", "serde", - "serde-wasm-bindgen 0.6.3", + "serde-wasm-bindgen 0.6.1", "serde_urlencoded", "thiserror", "wasm-bindgen", @@ -853,7 +867,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -867,9 +881,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -897,9 +911,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "http" @@ -941,30 +955,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9311685eb9a34808bbb0608ad2fcab9ae216266beca5848613e95553ac914e3b" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] name = "indexmap" -version = "2.2.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.2", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -986,9 +1000,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" @@ -1015,9 +1029,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "miniz_oxide" @@ -1044,24 +1058,24 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi 0.3.3", "libc", ] [[package]] name = "object" -version = "0.32.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "paste" @@ -1098,28 +1112,28 @@ checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -1147,9 +1161,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "ppv-lite86" @@ -1169,12 +1183,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -1189,11 +1203,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.20.7", ] [[package]] @@ -1222,9 +1236,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1268,9 +1282,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1322,13 +1336,12 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.43" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ "bitvec", "bytecheck", - "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -1340,9 +1353,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.43" +version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ "proc-macro2", "quote", @@ -1357,9 +1370,9 @@ checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] name = "rust_decimal" -version = "1.34.2" +version = "1.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755392e1a2f77afd95580d3f0d0e94ac83eeeb7167552c9b5bca549e61a94d83" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ "arrayvec", "borsh", @@ -1385,9 +1398,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "seahash" @@ -1397,9 +1410,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] @@ -1417,9 +1430,9 @@ dependencies = [ [[package]] name = "serde-wasm-bindgen" -version = "0.6.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b713f70513ae1f8d92665bbbbda5c295c2cf1da5542881ae5eefe20c9af132" +checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" dependencies = [ "js-sys", "serde", @@ -1428,20 +1441,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1450,9 +1463,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -1492,9 +1505,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "strsim" @@ -1546,7 +1559,7 @@ dependencies = [ "roxmltree", "serde", "serde_json", - "svgtypes", + "svgtypes 0.13.0", "uom", ] @@ -1563,7 +1576,7 @@ dependencies = [ "paste", "roxmltree", "serde", - "svgtypes", + "svgtypes 0.13.0", "uom", ] @@ -1579,7 +1592,7 @@ dependencies = [ "serde_json", "structopt", "svg2gcode 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "svgtypes", + "svgtypes 0.12.0", ] [[package]] @@ -1599,7 +1612,7 @@ dependencies = [ "serde", "serde_json", "svg2gcode 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "svgtypes", + "svgtypes 0.12.0", "thiserror", "wasm-bindgen", "wasm-bindgen-futures", @@ -1610,6 +1623,16 @@ dependencies = [ "zip", ] +[[package]] +name = "svgtypes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" +dependencies = [ + "kurbo", + "siphasher", +] + [[package]] name = "svgtypes" version = "0.13.0" @@ -1633,9 +1656,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -1651,7 +1674,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -1675,15 +1698,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "termcolor" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -1699,22 +1722,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -1734,9 +1757,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "pin-project-lite", @@ -1755,14 +1778,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.21.0", ] [[package]] @@ -1787,9 +1810,20 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap", "serde", @@ -1817,7 +1851,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] @@ -1865,9 +1899,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.7.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" [[package]] name = "vec_map" @@ -1895,9 +1929,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1905,24 +1939,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -1932,9 +1966,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1942,22 +1976,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-logger" @@ -1972,9 +2006,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -2013,9 +2047,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winnow" -version = "0.5.36" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -2072,16 +2106,17 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] name = "yewdux" -version = "0.10.0" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f3154e906048f189b77b241ec4956cb1cf341637dc89a4d0a24701e5a762bb" +checksum = "2ebc94bf7668ffd7470f27a9b323ef73d4dc3fdbe920477645f3adc104bc53f2" dependencies = [ "anymap", + "async-trait", "log", "serde", "serde_json", @@ -2095,15 +2130,15 @@ dependencies = [ [[package]] name = "yewdux-macros" -version = "0.10.0" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0701f8edd01519c953a9fcd3b88a2650a4351911f7492744e117d59f39f156c" +checksum = "d22b1832d3e3eaa61a5c2ecd40affa876507457180d1e599143368c1c3317c2d" dependencies = [ "darling", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.39", ] [[package]] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 475fe5b..51e2e92 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -15,7 +15,7 @@ g-code = "0.3" codespan-reporting = "0.11" structopt = "0.3" roxmltree = "0.19" -svgtypes = "0.13" +svgtypes = "0.12" serde_json = "1" [[bin]] diff --git a/lib/src/converter/mod.rs b/lib/src/converter/mod.rs index c940b56..86c1b95 100644 --- a/lib/src/converter/mod.rs +++ b/lib/src/converter/mod.rs @@ -236,10 +236,7 @@ impl<'a, T: Turtle> visit::XmlVisitor for ConversionVisitor<'a, T> { self.terrarium.line(true, x, y); } } else { - warn!( - "There is a polyline node containing no actual path: {:?}", - node - ); + warn!("There is a polyline node containing no actual path: {:?}", node); } } diff --git a/lib/src/turtle/g_code.rs b/lib/src/turtle/g_code.rs index 8949d61..522d332 100644 --- a/lib/src/turtle/g_code.rs +++ b/lib/src/turtle/g_code.rs @@ -89,8 +89,13 @@ impl<'input> Turtle for GCodeTurtle<'input> { fn move_to(&mut self, to: Point) { self.tool_off(); - self.program - .append(&mut command!(RapidPositioning { X: to.x, Y: to.y, }).into_token_vec()); + self.program.append( + &mut command!(RapidPositioning { + X: to.x, + Y: to.y, + }) + .into_token_vec(), + ); } fn line_to(&mut self, to: Point) { diff --git a/web/Cargo.toml b/web/Cargo.toml index ad906a5..0a41848 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -18,13 +18,13 @@ codespan = "0.11" serde = "1" paste = "1" log = "0.4" -svgtypes = "0.13" +svgtypes = "0.12" serde_json = "1" thiserror = "1.0" zip = { version = "0.6", default-features = false } yew = { version ="0.21", features = ["csr"] } -yewdux = "0.10" +yewdux = "0.9.4" web-sys = { version = "0.3", features = [] } wasm-logger = "0.2" gloo-file = { version = "0.3", features = ["futures"] } diff --git a/web/src/forms/mod.rs b/web/src/forms/mod.rs index fff7303..fd9dc4c 100644 --- a/web/src/forms/mod.rs +++ b/web/src/forms/mod.rs @@ -10,7 +10,7 @@ use wasm_bindgen::JsCast; use wasm_bindgen_futures::JsFuture; use web_sys::{window, Event, FileList, HtmlElement, HtmlInputElement, Response}; use yew::prelude::*; -use yewdux::{functional::use_store, use_dispatch}; +use yewdux::{functional::use_store, prelude::Dispatch}; use crate::{ state::{AppState, FormState, Svg}, @@ -28,7 +28,7 @@ use inputs::*; #[function_component(SettingsForm)] pub fn settings_form() -> Html { - let app_dispatch = use_dispatch::(); + let app_dispatch = Dispatch::::new(); let (form_state, form_dispatch) = use_store::(); let disabled = form_state.tolerance.is_err() @@ -205,8 +205,8 @@ pub fn settings_form() -> Html { #[function_component(ImportExportModal)] pub fn import_export_modal() -> Html { - let app_dispatch = use_dispatch::(); - let form_dispatch = use_dispatch::(); + let app_dispatch = Dispatch::::new(); + let form_dispatch = Dispatch::::new(); let import_state = use_state(|| Option::>::None); @@ -349,12 +349,12 @@ pub fn import_export_modal() -> Html { #[function_component(SvgForm)] pub fn svg_form() -> Html { - let app_dispatch = use_dispatch::(); + let app_dispatch = Dispatch::::new(); let file_upload_state = use_mut_ref(Vec::default); let file_upload_state_cloned = file_upload_state.clone(); let file_upload_onchange = - app_dispatch.future_callback_with(move |app, file_list: FileList| { + app_dispatch.reduce_mut_future_callback_with(move |app, file_list: FileList| { let file_upload_state_cloned = file_upload_state_cloned.clone(); Box::pin(async move { let mut results = Vec::with_capacity(file_list.length() as usize); @@ -384,9 +384,7 @@ pub fn svg_form() -> Html { .borrow_mut() .push(result.clone().map(|_| ())); } - app.reduce_mut(|app| { - app.svgs.extend(results.drain(..).filter_map(Result::ok)); - }); + app.svgs.extend(results.drain(..).filter_map(Result::ok)); }) }); @@ -422,7 +420,7 @@ pub fn svg_form() -> Html { let url_input_parsed = url_input_parsed.clone(); let url_add_loading = url_add_loading.clone(); - app_dispatch.future_callback_with(move |app, _| { + app_dispatch.reduce_mut_future_callback_with(move |app, _| { let url_input_state = url_input_state.clone(); let url_input_parsed = url_input_parsed.clone(); let url_add_loading = url_add_loading.clone(); @@ -449,12 +447,10 @@ pub fn svg_form() -> Html { &response_url, err )))); } else { - app.reduce_mut(|app| { - app.svgs.push(Svg { - content: text, - filename: response_url, - dimensions: [None; 2], - }); + app.svgs.push(Svg { + content: text, + filename: response_url, + dimensions: [None; 2], }); }; } diff --git a/web/src/main.rs b/web/src/main.rs index 9fb2f10..e7d5911 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -23,7 +23,7 @@ use forms::*; use state::*; use ui::*; use util::*; -use yewdux::{prelude::use_store, use_dispatch, YewduxRoot}; +use yewdux::prelude::{use_store, Dispatch}; use zip::{write::FileOptions, CompressionMethod, ZipWriter}; #[function_component] @@ -31,7 +31,7 @@ fn App(_props: &()) -> Html { let generating = use_state_eq(|| false); let generating_setter = generating.setter(); - let form_dispatch = use_dispatch::(); + let form_dispatch = Dispatch::::new(); let (app_store, app_dispatch) = use_store::(); // TODO: come up with a less awkward way to do this. @@ -54,7 +54,7 @@ fn App(_props: &()) -> Html { let opts = FileOptions::default().compression_method(CompressionMethod::Stored); if app_store.svgs.len() > 1 { - zip.add_directory("svg2gcode_output", opts).unwrap(); + zip.add_directory("svg2gcode_output", opts.clone()).unwrap(); } for svg in app_store.svgs.iter() { @@ -109,39 +109,36 @@ fn App(_props: &()) -> Html { Path::new(svg.filename.as_str()).with_extension("gcode") }; - match app_store.svgs.len() { - 0 => unreachable!(), - 1 => { - let gcode = { - let mut acc = String::new(); - format_gcode_fmt( - &program, - FormatOptions { - checksums: app_store.settings.postprocess.checksums, - line_numbers: app_store.settings.postprocess.line_numbers, - ..Default::default() - }, - &mut acc, - ) - .unwrap(); - acc - }; - prompt_download(filepath, gcode.as_bytes()); - } - _multiple => { - zip.start_file(filepath.to_string_lossy(), opts).unwrap(); + if app_store.svgs.len() > 1 { + zip.start_file(filepath.to_string_lossy(), opts.clone()) + .unwrap(); - format_gcode_io( + format_gcode_io( + &program, + FormatOptions { + checksums: app_store.settings.postprocess.checksums, + line_numbers: app_store.settings.postprocess.line_numbers, + ..Default::default() + }, + &mut zip, + ) + .unwrap(); + } else if app_store.svgs.len() == 1 { + let gcode = { + let mut acc = String::new(); + format_gcode_fmt( &program, FormatOptions { checksums: app_store.settings.postprocess.checksums, line_numbers: app_store.settings.postprocess.line_numbers, ..Default::default() }, - &mut zip, + &mut acc, ) .unwrap(); - } + acc + }; + prompt_download(filepath, gcode.as_bytes()); } } @@ -163,83 +160,81 @@ fn App(_props: &()) -> Html { }; html! { - -
-
-

- { "svg2gcode" } -

-

- { env!("CARGO_PKG_DESCRIPTION") } -

- - -
- - -
-
-

- { "See the project " } - - { "on GitHub" } - - {" for support" } -

+ disabled={generate_disabled} + onclick={generate_onclick} + /> + + +
+ { + for app_store.svgs.iter().enumerate().map(|(i, svg)| { + let svg_base64 = base64::engine::general_purpose::STANDARD_NO_PAD.encode(svg.content.as_bytes()); + let remove_svg_onclick = app_dispatch.reduce_mut_callback(move |app| { + app.svgs.remove(i); + }); + let footer = html!{ +
+ + +
+
+

+ { "See the project " } + + { "on GitHub" } + + {" for support" } +

-
+ } } diff --git a/web/src/ui/mod.rs b/web/src/ui/mod.rs index 635bfbd..4dd72ca 100644 --- a/web/src/ui/mod.rs +++ b/web/src/ui/mod.rs @@ -361,7 +361,7 @@ where props.default.as_ref(), node_ref.cast::(), ) { - input_element.set_value(default.as_ref()); + input_element.set_value(&default.to_string()); applied_default_value.set(true); }