fix-wasm-foo #2
8 changed files with 1068 additions and 4742 deletions
5713
Cargo.lock
generated
5713
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
15
Cargo.toml
15
Cargo.toml
|
@ -6,10 +6,6 @@ lto = "thin"
|
|||
opt-level = 3
|
||||
[profile.dev.package.frozen_llama]
|
||||
opt-level = 1
|
||||
[profile.dev.package.llama_forge_rs]
|
||||
opt-level = 1
|
||||
[profile.dev.package.leptos_stub]
|
||||
opt-level = 1
|
||||
|
||||
|
||||
[profile.release]
|
||||
|
@ -27,7 +23,7 @@ lto = "fat"
|
|||
panic = "abort"
|
||||
|
||||
[workspace]
|
||||
members = ["llama_forge_rs", "frozen_llama", "llama_proxy_man", "redvault_el_rs", "garnix"]
|
||||
members = ["frozen_llama", "llama_proxy_man", "redvault_el_rs", "garnix"]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
|
@ -42,15 +38,6 @@ edition = "2021"
|
|||
|
||||
[workspace.dependencies]
|
||||
# iced = { git = "https://github.com/iced-rs/iced.git", branch = "master" }
|
||||
iced = { version = "0.13" }
|
||||
leptos = { version = "0.6", features = ["serde"] }
|
||||
leptos_axum = { version = "0.6" }
|
||||
leptos_meta = { version = "0.6" }
|
||||
leptos_router = { version = "0.6" }
|
||||
server_fn = { version = "0.6" }
|
||||
axum = { version = "0.7", features = ["macros"] }
|
||||
http = "1.1"
|
||||
wasm-bindgen = "=0.2.93"
|
||||
|
||||
[workspace.metadata.cargo-all-features]
|
||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -108,11 +108,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1736077418,
|
||||
"narHash": "sha256-2LwAcQXlLkqWyibkYGiS1SfXsewxRuhpYtzrMQSYElc=",
|
||||
"lastModified": 1738758495,
|
||||
"narHash": "sha256-CZ8T4vP3ag2hwkpSZjatxJb55ouszvmnWw09qxGW9TU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e554bf17658bd1bfe393dcaca8b8eee6014ddfa1",
|
||||
"rev": "ceaea203f3ae1787b1bd13f021f686391696fc5b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
21
flake.nix
21
flake.nix
|
@ -142,9 +142,10 @@
|
|||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs;
|
||||
[
|
||||
customNodeModules
|
||||
customRustToolchain
|
||||
self.packages.${system}.myllamacpp
|
||||
# customNodeModules
|
||||
# customRustToolchain
|
||||
# self.packages.${system}.myllamacpp
|
||||
rustup
|
||||
bacon
|
||||
binaryen
|
||||
cacert
|
||||
|
@ -158,17 +159,19 @@
|
|||
cargo-make
|
||||
cargo-generate
|
||||
cargo-udeps
|
||||
self.packages.${system}.cargo-leptos
|
||||
(wasm-bindgen-cli.override {
|
||||
version = "0.2.93";
|
||||
hash = "sha256-DDdu5mM3gneraM85pAepBXWn3TMofarVR4NbjMdz3r0=";
|
||||
cargoHash = "sha256-birrg+XABBHHKJxfTKAMSlmTVYLmnmqMDfRnmG6g/YQ=";
|
||||
})
|
||||
# self.packages.${system}.cargo-leptos
|
||||
wasm-bindgen-cli
|
||||
# (wasm-bindgen-cli.override {
|
||||
# version = "0.2.93";
|
||||
# hash = "sha256-DDdu5mM3gneraM85pAepBXWn3TMofarVR4NbjMdz3r0=";
|
||||
# cargoHash = "sha256-birrg+XABBHHKJxfTKAMSlmTVYLmnmqMDfRnmG6g/YQ=";
|
||||
# })
|
||||
cargo-outdated
|
||||
cargo-release
|
||||
calc
|
||||
# jre8 # needed for xmlls
|
||||
dart-sass
|
||||
# trunk
|
||||
fish
|
||||
inotify-tools
|
||||
leptosfmt
|
||||
|
|
|
@ -6,8 +6,7 @@ edition.workspace=true
|
|||
publish.workspace=true
|
||||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced = { version = "0.13", features = [ "markdown", "highlighter" ]}
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["webgl"]
|
||||
iced = { version = "0.13", features = [ "markdown", "highlighter", "webgl" ]}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
<base data-trunk-public-url />
|
||||
</head>
|
||||
<body>
|
||||
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-bin="counter" />
|
||||
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-bin="frozen_llama" />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
use iced::widget::{button, column, text, Column};
|
||||
use iced::Center;
|
||||
|
||||
mod markdown;
|
||||
use markdown::*;
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::run("A cool counter", Counter::update, Counter::view)
|
||||
let md = markdown::Markdown::new();
|
||||
// iced::run("A cool counter", Counter::update, Counter::view)
|
||||
iced::run("", markdown::Markdown::update, markdown::Markdown::view)
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -32,7 +37,7 @@ impl Counter {
|
|||
column![
|
||||
button("Increment").on_press(Message::Increment),
|
||||
text(self.value).size(50),
|
||||
button("Decrement").on_press(Message::Decrement)
|
||||
button("Decrement").on_press(Message::Decrement),
|
||||
]
|
||||
.padding(20)
|
||||
.align_x(Center)
|
||||
|
|
39
frozen_llama/src/markdown.rs
Normal file
39
frozen_llama/src/markdown.rs
Normal file
|
@ -0,0 +1,39 @@
|
|||
use iced::widget::markdown;
|
||||
use iced::Element;
|
||||
use iced::Theme;
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct Markdown {
|
||||
markdown: Vec<markdown::Item>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Message {
|
||||
LinkClicked(markdown::Url),
|
||||
}
|
||||
|
||||
impl Markdown {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
markdown: markdown::parse("This is some **Markdown**!").collect(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn view(&self) -> Element<'_, Message> {
|
||||
markdown::view(
|
||||
&self.markdown,
|
||||
markdown::Settings::default(),
|
||||
markdown::Style::from_palette(Theme::TokyoNightStorm.palette()),
|
||||
)
|
||||
.map(Message::LinkClicked)
|
||||
.into()
|
||||
}
|
||||
|
||||
pub fn update(_state: &mut Self, message: Message) {
|
||||
match message {
|
||||
Message::LinkClicked(url) => {
|
||||
println!("The following url was clicked: {url}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue