diff --git a/crates/bevy_text/Cargo.toml b/crates/bevy_text/Cargo.toml index 413870c0911ad..3243cd3168793 100644 --- a/crates/bevy_text/Cargo.toml +++ b/crates/bevy_text/Cargo.toml @@ -34,7 +34,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-fea # other cosmic-text = { version = "0.14", features = ["shape-run-cache"] } -cosmic_undo_2 = { version = "0.2.0" } +bevy_undo_2 = { version = "0.3.0" } thiserror = { version = "2", default-features = false } serde = { version = "1", features = ["derive"] } smallvec = { version = "1", default-features = false } diff --git a/crates/bevy_text/src/input.rs b/crates/bevy_text/src/input.rs index d5bf5dc36f1b6..2eb60eb33b0a7 100644 --- a/crates/bevy_text/src/input.rs +++ b/crates/bevy_text/src/input.rs @@ -141,7 +141,7 @@ impl TextInputBuffer { #[derive(Component, Debug, Default)] pub struct UndoHistory { /// The commands to undo and undo - pub changes: cosmic_undo_2::Commands, + pub changes: bevy_undo_2::Commands, } impl UndoHistory { @@ -248,7 +248,7 @@ impl Default for TextInputAttributes { } /// If a text input entity has a `TextInputFilter` component, after each [TextEdit] is applied, the [TextInputBuffer]’s text is checked -/// against the filter, and if it fails, the `TextEdit is rolled back. +/// against the filter, and if it fails, the `TextEdit` is rolled back. #[derive(Component)] pub enum TextInputFilter { /// Positive integer input @@ -458,13 +458,13 @@ pub fn is_cursor_at_end_of_line(editor: &mut BorrowedWithFontSystem>) /// apply an action from the undo history to the text input buffer fn apply_action<'a>( editor: &mut BorrowedWithFontSystem>, - action: cosmic_undo_2::Action<&cosmic_text::Change>, + action: bevy_undo_2::Action<&cosmic_text::Change>, ) { match action { - cosmic_undo_2::Action::Do(change) => { + bevy_undo_2::Action::Do(change) => { editor.apply_change(change); } - cosmic_undo_2::Action::Undo(change) => { + bevy_undo_2::Action::Undo(change) => { let mut reversed = change.clone(); reversed.reverse(); editor.apply_change(&reversed); @@ -475,8 +475,8 @@ fn apply_action<'a>( /// Applies the [`TextEdit`]s queued for each [`TextInputBuffer`]. /// -/// After all edits are applied, if a text input entity has a [TextInputValue] component and its buffer was changed, -/// then the [TextInputValue]'s text is updated with the new contents of the [TextInputBuffer]. +/// After all edits are applied, if a text input entity has a [`TextInputValue`] component and its buffer was changed, +/// then the [`TextInputValue`]'s text is updated with the new contents of the [`TextInputBuffer`]. pub fn apply_text_edits( mut commands: Commands, mut font_system: ResMut, diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs index d3f9cbd279016..d5d041a62ce57 100644 --- a/crates/bevy_ui/src/lib.rs +++ b/crates/bevy_ui/src/lib.rs @@ -196,6 +196,9 @@ impl Plugin for UiPlugin { let ui_layout_system_config = ui_layout_system .in_set(UiSystems::Layout) + .ambiguous_with(bevy_text::update_password_masks) + .ambiguous_with(bevy_text::update_placeholder_layouts) + .ambiguous_with(bevy_text::update_text_input_layouts) .before(TransformSystems::Propagate); let ui_layout_system_config = ui_layout_system_config @@ -257,6 +260,9 @@ fn build_text_interop(app: &mut App) { ) .chain() .in_set(UiSystems::Content) + .ambiguous_with(bevy_text::update_password_masks) + .ambiguous_with(bevy_text::update_placeholder_layouts) + .ambiguous_with(bevy_text::update_text_input_layouts) // Text and Text2d are independent. .ambiguous_with(bevy_text::detect_text_needs_rerender::) // Potential conflict: `Assets` @@ -271,6 +277,9 @@ fn build_text_interop(app: &mut App) { .after(bevy_text::remove_dropped_font_atlas_sets) .before(bevy_asset::AssetEventSystems) // Text2d and bevy_ui text are entirely on separate entities + .ambiguous_with(bevy_text::update_password_masks) + .ambiguous_with(bevy_text::update_placeholder_layouts) + .ambiguous_with(bevy_text::update_text_input_layouts) .ambiguous_with(bevy_text::detect_text_needs_rerender::) .ambiguous_with(bevy_text::update_text2d_layout) .ambiguous_with(bevy_text::calculate_bounds_text2d),