@effindomv2/fui-rs 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fui-rs"
3
- version = "0.1.6"
3
+ version = "0.1.8"
4
4
  edition = "2021"
5
5
  license = "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial"
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effindomv2/fui-rs",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "license": "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial",
6
6
  "description": "EffinDom v2 Rust frontend framework SDK and host generators",
@@ -7,7 +7,7 @@ pub fn flex_box() -> FlexBox {
7
7
  FlexBox::default()
8
8
  }
9
9
 
10
- pub fn text(content: &str) -> TextNode {
10
+ pub fn text(content: impl Into<String>) -> TextNode {
11
11
  TextNode::new(content)
12
12
  }
13
13
 
@@ -86,8 +86,6 @@ pub(crate) fn apply_flex_box_props(
86
86
  props: &FlexBoxProps,
87
87
  behavior: NodeBehavior,
88
88
  ) {
89
- ui::set_width(handle.raw(), 0.0, Unit::Auto as u32);
90
- ui::set_height(handle.raw(), 0.0, Unit::Auto as u32);
91
89
  ui::set_fill_width(handle.raw(), behavior.fill_width);
92
90
  ui::set_fill_height(handle.raw(), behavior.fill_height);
93
91
  if let Some(percent) = behavior.fill_width_percent {
@@ -183,9 +181,12 @@ pub(crate) fn apply_text_props(handle: NodeHandle, props: &TextProps, behavior:
183
181
  if props.has_style_runs {
184
182
  ui::set_text_style_runs(handle.raw(), &props.style_runs);
185
183
  }
186
- if let Some(color) = props.text_color {
187
- ui::set_text_color(handle.raw(), color);
188
- }
184
+ ui::set_text_color(
185
+ handle.raw(),
186
+ props
187
+ .text_color
188
+ .unwrap_or_else(|| crate::theme::current_theme().colors.text_primary),
189
+ );
189
190
  if let Some(line_height) = props.line_height {
190
191
  ui::set_line_height(handle.raw(), line_height);
191
192
  }
@@ -306,8 +307,6 @@ pub(crate) fn apply_scroll_view_props(
306
307
  props: &ScrollViewProps,
307
308
  behavior: NodeBehavior,
308
309
  ) {
309
- ui::set_width(handle.raw(), 0.0, Unit::Auto as u32);
310
- ui::set_height(handle.raw(), 0.0, Unit::Auto as u32);
311
310
  ui::set_fill_width(handle.raw(), behavior.fill_width);
312
311
  ui::set_fill_height(handle.raw(), behavior.fill_height);
313
312
  if let Some(percent) = behavior.fill_width_percent {