From de00a4de664eef61fbe6628d8559539f3bfb80c0 Mon Sep 17 00:00:00 2001 From: Condorra Date: Fri, 22 Nov 2024 23:52:49 +1100 Subject: [PATCH] Implement HTML view type. --- src/frame_view.rs | 5 +++ src/html_view.rs | 12 +++++++ src/lua_engine.rs | 1 + src/lua_engine/frames.rs | 54 ++++++++++++++++++++++++++++++- src/main.rs | 1 + src/term_split.rs | 68 +++++++++++++++++++++++++++++++++++++++- styles.css | 7 +++++ 7 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 src/html_view.rs diff --git a/src/frame_view.rs b/src/frame_view.rs index f38c761..4e319d5 100644 --- a/src/frame_view.rs +++ b/src/frame_view.rs @@ -8,6 +8,7 @@ use yew::prelude::*; use crate::{ command_handler::command_handler, editor_view::CodeEditorView, + html_view::HtmlView, lineengine::line::{Readline, ReadlineEvent}, term_split::TermSplit, timer_host::TimerHost, @@ -76,6 +77,7 @@ pub struct FrameId(pub u64); pub enum FrameViewType { Terminal, Editor, + Html { inner: String }, } #[derive(Properties)] @@ -239,6 +241,9 @@ pub fn term_view(props: &TermViewProps) -> Html { global_memo={props.global_memo.clone()} global_layout={props.global_layout.clone()}/> }, + FrameViewType::Html { inner } => html! { + + }, } } diff --git a/src/html_view.rs b/src/html_view.rs new file mode 100644 index 0000000..74575e1 --- /dev/null +++ b/src/html_view.rs @@ -0,0 +1,12 @@ +use yew::prelude::*; +use yew::{function_component, Properties}; + +#[derive(Properties, PartialEq)] +pub struct HtmlViewProps { + pub inner: String, +} + +#[function_component(HtmlView)] +pub fn html_view(props: &HtmlViewProps) -> Html { + html! {