Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "monaco"
version = "0.6.0"
version = "0.7.0"
authors = ["Simon Berger <simon@siku2.io>"]
edition = "2018"
description = "Rust WASM bindings for the Monaco Editor"
Expand Down Expand Up @@ -28,7 +28,7 @@ yew-components = ["api", "yew"]
js-sys = "0.3"
paste = "1.0"
wasm-bindgen = "0.2"
yew = { version = "0.22", features = ["csr"], optional = true }
yew = { version = "0.23", features = ["csr"], optional = true }

[dependencies.web-sys]
version = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion examples/yew/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2018"
[dependencies]
monaco = { path = "../..", features = ["yew-components"] }
wasm-bindgen = "0.2"
yew = { version = "0.22", features = ["csr"] }
yew = { version = "0.23", features = ["csr"] }
28 changes: 6 additions & 22 deletions examples/yew/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use monaco::{api::CodeEditorOptions, sys::editor::BuiltinTheme, yew::CodeEditor};
use std::rc::Rc;
use yew::{html, Component, Context, Html};
use yew::prelude::*;

const CONTENT: &str = include_str!("main.rs");

Expand All @@ -12,27 +11,12 @@ fn get_options() -> CodeEditorOptions {
.with_automatic_layout(true)
}

struct App {
options: Rc<CodeEditorOptions>,
}
impl Component for App {
type Message = ();
type Properties = ();

fn create(_context: &Context<Self>) -> Self {
Self {
options: Rc::new(get_options()),
}
}

fn changed(&mut self, _context: &Context<Self>, _old_props: &Self::Properties) -> bool {
false
}
#[component]
fn App() -> Html {
let options = get_options().to_sys_options();

fn view(&self, _context: &Context<Self>) -> Html {
html! {
<CodeEditor classes={"full-height"} options={ self.options.to_sys_options() } />
}
html! {
<CodeEditor classes={"full-height"} options={options} />
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/yew_events_external/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
monaco = { path = "../..", features = ["yew-components"] }
wasm-bindgen = "0.2"
yew = { version = "0.22", features = ["csr"] }
yew = { version = "0.23", features = ["csr"] }

# Used for the randomess, not needed usually.
getrandom = { version = "0.2", features = ["js"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/yew_events_keymapping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2018"
[dependencies]
monaco = { path = "../..", features = ["yew-components"] }
wasm-bindgen = "0.2"
yew = { version = "0.22", features = ["csr"] }
yew = { version = "0.23", features = ["csr"] }
2 changes: 1 addition & 1 deletion examples/yew_model_decorations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2018"
monaco = { path = "../..", features = ["yew-components"] }
wasm-bindgen = "0.2"
js-sys = "0.3"
yew = { version = "0.22", features = ["csr"] }
yew = { version = "0.23", features = ["csr"] }
Loading