Skip to content

Commit

Permalink
♻️ Rename models.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Oct 25, 2024
1 parent 1b1d528 commit 564ba2d
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 75 deletions.
4 changes: 2 additions & 2 deletions packages/components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ yew = { workspace = true }
yew-router = { workspace = true }

html5ever = { version = "^0.29", optional = true }
comrak = { version = "^0.29", optional = true }
markdown = { version = "1.0.0-alpha.21", optional = true }
parse-wiki-text-2 = { version = "^0.2", optional = true }

egui = { version = "^0.29", optional = true }
Expand All @@ -56,7 +56,7 @@ form-input-rich = [
"form-input-rich-mediawiki",
]
form-input-rich-html = ["dep:html5ever"]
form-input-rich-markdown = ["dep:comrak"]
form-input-rich-markdown = ["dep:markdown"]
form-input-rich-mediawiki = ["dep:parse-wiki-text-2"]

data-canvas = ["data-canvas-charts", "data-canvas-scene"]
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/data/canvas/charts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// https://echarts.apache.org/
// https://egui.rs/
// https://github.com/emilk/egui_plot/
4 changes: 2 additions & 2 deletions packages/components/src/data/canvas/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(features = "data-canvas-charts")]
#[cfg(feature = "data-canvas-charts")]
pub mod charts;
#[cfg(features = "data-canvas-scene")]
#[cfg(feature = "data-canvas-scene")]
pub mod scene;
4 changes: 4 additions & 0 deletions packages/components/src/data/paragraph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
mod affix;
mod badge;
mod chip;

mod rich;
mod typography;

mod avatar;
Expand All @@ -10,6 +12,8 @@ mod image;
pub use affix::Affix;
pub use badge::Badge;
pub use chip::Chip;

pub use rich::Rich;
pub use typography::Typography;

pub use avatar::Avatar;
Expand Down
20 changes: 20 additions & 0 deletions packages/components/src/data/paragraph/rich/markdown/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#[cfg(test)]
mod test {
#[test]
fn test() {
use markdown::{to_mdast, ParseOptions};

let input = r#"
```rust;ignored
fn main() {
println!("Hello, world!");
}
```
<SomeComponent />
{a + b} // inline code
"#;
println!("{:?}", to_mdast(input, &ParseOptions::mdx()).unwrap());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
pub struct RichTextInputProps {
pub struct RichProps {
#[prop_or_default]
pub children: Children,
}

#[styled_component]
pub fn RichTextInput(props: &RichTextInputProps) -> Html {
pub fn Rich(props: &RichProps) -> Html {
html! {
<div
class={css!(r#"
Expand Down
23 changes: 0 additions & 23 deletions packages/components/src/form/input/markdown_input.rs

This file was deleted.

18 changes: 6 additions & 12 deletions packages/components/src/form/input/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
pub mod rich;
mod rich;
mod text;
mod text_area;

mod char_input;
mod markdown_input;
mod password_input;
mod text_area_input;
mod text_input;

pub use char_input::CharInput;
pub use markdown_input::MarkdownInput;
pub use password_input::PasswordInput;
pub use text_area_input::TextAreaInput;
pub use text_input::TextInput;
pub use rich::RichInput;
pub use text::TextInput;
pub use text_area::TextAreaInput;
23 changes: 0 additions & 23 deletions packages/components/src/form/input/password_input.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use stylist::yew::styled_component;
use yew::prelude::*;

#[derive(Properties, Debug, PartialEq)]
pub struct CharInputProps {
pub struct RichInputProps {
#[prop_or_default]
pub children: Children,
}

#[styled_component]
pub fn CharInput(props: &CharInputProps) -> Html {
pub fn RichInput(props: &RichInputProps) -> Html {
html! {
<div
class={css!(r#"
Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions packages/components/src/form/picker/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
mod color_picker;
mod date_picker;
mod date_time_picker;
mod time_picker;
mod color;
mod date;
mod date_time;
mod time;

pub use color_picker::ColorPicker;
pub use date_picker::DatePicker;
pub use date_time_picker::DateTimePicker;
pub use time_picker::TimePicker;
pub use color::ColorPicker;
pub use date::DatePicker;
pub use date_time::DateTimePicker;
pub use time::TimePicker;
File renamed without changes.

0 comments on commit 564ba2d

Please sign in to comment.