Skip to content

Commit 4036189

Browse files
committed
fill changelog
1 parent 567dcaf commit 4036189

File tree

10 files changed

+126
-91
lines changed

10 files changed

+126
-91
lines changed

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
"event": "onFileChange"
1111
}
1212
],
13-
"nls.server.path": "/home/avi/Downloads/nls-x86_64-linux"
1413
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
44

55
## unreleased
66

7+
### added
8+
9+
- ability to disable clearing previous text input selections on focus change
10+
11+
### changed
12+
13+
- upgraded Bevy to `0.16.1`
14+
- migrated `TextInput` from unmaintained [bevy_cosmic_edit](https://github.com/Dimchikkk/bevy_cosmic_edit) to [bevy_ui_text_input](https://github.com/ickshonpe/bevy_ui_text_input)
15+
- migrated from once-cell to `std::sync::LazyLock`
16+
717
# 0.4.1 (2025-04-08)
818

919
### added

examples/character_editor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ fn main() {
3535
},
3636
),
3737
)
38-
// .add_systems(Update, name_changed)
3938
.add_observer(
4039
|event: Trigger<SetShape>,
4140
character: Single<Entity, With<MeshMaterial3d<StandardMaterial>>>,

justfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import? 'kaaj.just'
1+
KAAJ_HAALKA_COMMIT := "5091123d38b0a0eafd3b7d6b46350f6072748f0b"
22

33
fetch_kaaj_justfile:
4-
# curl https://raw.githubusercontent.com/databasedav/haalka/main/justfile > haalka.just
5-
cp kaaj/justfile kaaj.just
4+
curl https://raw.githubusercontent.com/databasedav/haalka/{{ KAAJ_HAALKA_COMMIT }}/kaaj/justfile > kaaj.just
5+
6+
import? 'kaaj.just'
67

78
# TODO: use an actual list https://github.com/casey/just/issues/2458
89
exclude_examples := '"accordion", "challenge07", "draggable", "many_buttons", "utils"'
@@ -14,4 +15,4 @@ sync_counter_example_readme:
1415
uv run python sync_counter_example_readme.py
1516

1617
repo_prompt:
17-
@nickel eval repo_prompt.ncl --field output | sed 's/^"//; s/"$//; s/\\"/"/g; s/\\n/\n/g'
18+
@nickel eval repo_prompt.ncl | sed 's/^"//; s/"$//; s/\\"/"/g; s/\\n/\n/g'

kaaj/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# kaaj [কাজ](https://translate.google.com/?sl=bn&tl=en&text=%E0%A6%95%E0%A6%BE%E0%A6%9C&op=translate)
2+
3+
```text
4+
in bengali, kaaj means "work"
5+
```
6+
7+
kaaj is both a nickel package that provides output targets for github actions workflows and an attached justfile for Bevy-related CI, including building examples, serving examples on the web, releasing crates, etc.
8+
9+
kaaj is used in [haalka](https://github.com/databasedav/haalka), [aalo](https://github.com/databasedav/aalo), and [jonmo](https://github.com/databasedav/jonmo)
10+
11+
## usage
12+
13+
add kaaj to your `Nickel-pkg.ncl`
14+
15+
```
16+
dependencies = {
17+
kaaj = 'Git { url = "https://github.com/databasedav/haalka", ref = 'Tag "v0.1" },
18+
}
19+
```
20+
21+
then add the desired targets to your `.ncl`, for example
22+
23+
```ncl
24+
let { build_example, ci, cleanup_pr_previews, examples_on_main, pr_previews, release, wasm_example_index_template, .. } = import kaaj in
25+
let REPO = "https://github.com/databasedav/haalka" in
26+
let GITHUB_PAGES_URL = "https://databasedav.github.io/haalka" in
27+
{
28+
build_example_ = build_example "webgpu",
29+
ci_ = ci,
30+
cleanup_pr_previews_ = cleanup_pr_previews REPO,
31+
pr_previews_ = pr_previews REPO GITHUB_PAGES_URL,
32+
examples_on_main_ = examples_on_main,
33+
release_ = release,
34+
}
35+
36+
```
37+
38+
then in your `justfile` add the following, adjusting `exclude_examples` and `export_nickels` as desired
39+
40+
```just
41+
KAAJ_HAALKA_COMMIT := "5091123d38b0a0eafd3b7d6b46350f6072748f0b"
42+
43+
fetch_kaaj_justfile:
44+
curl https://raw.githubusercontent.com/databasedav/haalka/{{ KAAJ_HAALKA_COMMIT }}/kaaj/justfile > kaaj.just
45+
46+
import? 'kaaj.just'
47+
48+
exclude_examples := '"example1", "example2"'
49+
50+
export_nickels := "ci build_example pr_previews examples_on_main cleanup_pr_previews release"
51+
```
52+
53+
and finally, generate the github actions workflows with just
54+
```
55+
just sync_nickels
56+
```

repo_prompt.ncl

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
let Output = Dyn in
2-
let Contract = Dyn in
31
let src_align = import "src/align.rs" as 'Text in
42
let src_column = import "src/column.rs" as 'Text in
53
let src_derive = import "src/derive.rs" as 'Text in
@@ -82,54 +80,52 @@ let repo_structure = {
8280
} in
8381
let prompt = import "repo_prompt_input.md" as 'Text in
8482

85-
{
86-
output | Output = m%"
87-
%{ prompt }
83+
m%"
84+
%{ prompt }
8885

89-
haalka is an ergonomic reactive UI library in rust for the bevy game engine; here is the structure of the haalka repository with the contents of each file:
90-
.
91-
├── examples/
92-
│ ├── align.rs
93-
│ ├── button.rs
94-
│ ├── calculator.rs
95-
│ ├── challenge07.rs
96-
│ ├── character_editor.rs
97-
│ ├── counter.rs
98-
│ ├── dot_counter.rs
99-
│ ├── healthbar.rs
100-
│ ├── inventory.rs
101-
│ ├── key_values_sorted.rs
102-
│ ├── main_menu.rs
103-
│ ├── many_buttons.rs
104-
│ ├── nested_lists.rs
105-
│ ├── responsive_menu.rs
106-
│ ├── scroll_grid.rs
107-
│ ├── scroll.rs
108-
│ ├── snake.rs
109-
│ ├── test.rs
110-
│ └── utils.rs
111-
└── src/
112-
├── align.rs
113-
├── column.rs
114-
├── derive.rs
115-
├── element.rs
116-
├── el.rs
117-
├── global_event_aware.rs
118-
├── grid.rs
119-
├── lib.rs
120-
├── mouse_wheel_scrollable.rs
121-
├── nearby_element_addable.rs
122-
├── node_builder.rs
123-
├── paragraph.rs
124-
├── pointer_event_aware.rs
125-
├── raw.rs
126-
├── row.rs
127-
├── sizeable.rs
128-
├── stack.rs
129-
├── text_input.rs
130-
├── utils.rs
131-
└── viewport_mutable.rs
86+
haalka is an ergonomic reactive UI library in rust for the bevy game engine; here is the structure of the haalka repository with the contents of each file:
87+
.
88+
├── examples/
89+
│ ├── align.rs
90+
│ ├── button.rs
91+
│ ├── calculator.rs
92+
│ ├── challenge07.rs
93+
│ ├── character_editor.rs
94+
│ ├── counter.rs
95+
│ ├── dot_counter.rs
96+
│ ├── healthbar.rs
97+
│ ├── inventory.rs
98+
│ ├── key_values_sorted.rs
99+
│ ├── main_menu.rs
100+
│ ├── many_buttons.rs
101+
│ ├── nested_lists.rs
102+
│ ├── responsive_menu.rs
103+
│ ├── scroll_grid.rs
104+
│ ├── scroll.rs
105+
│ ├── snake.rs
106+
│ ├── test.rs
107+
│ └── utils.rs
108+
└── src/
109+
├── align.rs
110+
├── column.rs
111+
├── derive.rs
112+
├── element.rs
113+
├── el.rs
114+
├── global_event_aware.rs
115+
├── grid.rs
116+
├── lib.rs
117+
├── mouse_wheel_scrollable.rs
118+
├── nearby_element_addable.rs
119+
├── node_builder.rs
120+
├── paragraph.rs
121+
├── pointer_event_aware.rs
122+
├── raw.rs
123+
├── row.rs
124+
├── sizeable.rs
125+
├── stack.rs
126+
├── text_input.rs
127+
├── utils.rs
128+
└── viewport_mutable.rs
132129

133-
%{ repo_structure |> std.record.map (fun k v => "%{ k }\n```rust\n%{ v }\n```") |> std.record.values |> std.string.join "\n\n" }
134-
"%
135-
}
130+
%{ repo_structure |> std.record.map (fun k v => "%{ k }\n```rust\n%{ v }\n```") |> std.record.values |> std.string.join "\n\n" }
131+
"%

src/paragraph.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// TODO: signal abstraction over text sections
2-
1+
// TODO: signal abstraction over text spans

src/pointer_event_aware.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ pub trait PointerEventAware: GlobalEventAware {
207207
)
208208
.apply(remove_system_holder_on_remove(system_holder))
209209
})
210-
// .on_global_event_with_system::<Pointer<Released>, _>(move |pointer_up: Listener<Pointer<Released>>| if
211-
// matches!(pointer_up.button, PointerButton::Primary) { down.set_neq(false) }) TODO: this isn't the
212-
// desired behavior, press should linger outside and instead `Up` should trigger even outside of element
213-
// (like the `.on_global_event_with_system` commented out above), requires being able to register
214-
// multiple event listeners per event type
215210
.on_hovered_change_with_system(|In((entity, hovered)): In<(_, bool)>, world: &mut World| {
216211
if !hovered {
217212
if let Ok(ref mut entity) = world.get_entity_mut(entity) {

src/raw.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,10 @@ fn on_remove_on_remove(mut world: DeferredWorld, HookContext { entity, .. }: Hoo
709709
}
710710

711711
#[allow(clippy::type_complexity)]
712+
#[derive(Component)]
713+
#[component(on_remove = on_remove_on_remove)]
712714
struct OnRemove(Vec<Box<dyn FnOnce(&mut DeferredWorld, Entity) + Send + Sync + 'static>>);
713715

714-
impl Component for OnRemove {
715-
const STORAGE_TYPE: StorageType = StorageType::Table;
716-
type Mutability = Mutable;
717-
718-
fn on_remove() -> Option<ComponentHook> {
719-
Some(on_remove_on_remove)
720-
}
721-
}
722-
723716
/// Marker [`Component`] for filtering `SystemId` `Entity`s managed by haalka.
724717
#[derive(Component)]
725718
pub struct HaalkaOneShotSystem;

src/text_input.rs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ impl UiRootable for TextInput {}
4444
impl ViewportMutable for TextInput {}
4545
impl CursorOnHoverable for TextInput {}
4646

47-
/// A component to store the last text value that was successfully applied by `text_signal`.
48-
/// This is used to prevent echo updates from `on_change_sync` when a two-way binding is active.
49-
#[derive(Component, Default)]
50-
struct LastSignalText(String);
51-
5247
// TODO: allow managing multiple spans reactively
5348
impl TextInput {
5449
#[allow(missing_docs, clippy::new_without_default)]
@@ -63,19 +58,6 @@ impl TextInput {
6358
Pickable::default(),
6459
LastSignalText::default()
6560
))
66-
// .on_event_with_system::<Pointer<Pressed>, _>(
67-
// move |In((entity, _)): In<(_, Pointer<Pressed>)>,
68-
// mut focusable_query: Query<(Entity, &mut Focusable), Without<TextInputFocusOnDownDisabled>>,
69-
// mut commands: Commands| {
70-
// // TODO: remove this focusable trigger and uncomment .insert_resource below when https://github.com/Dimchikkk/bevy_cosmic_edit/issues/145
71-
// // otherwise cursor position is not instantly correct on `Down`
72-
// if let Ok((entity, mut focusable)) = focusable_query.get_mut(entity) {
73-
// focusable.is_focused = true;
74-
// commands.trigger_targets(FocusedChange(true), entity);
75-
// }
76-
// // commands.insert_resource(CosmicFocusedWidget(cosmic_edit_holder.get()));
77-
// },
78-
// )
7961
});
8062
Self { el }
8163
}
@@ -261,6 +243,11 @@ impl TextInput {
261243
}
262244
}
263245

246+
/// A component to store the last text value that was successfully applied by [`TextInput::text_signal`].
247+
/// This is used to prevent echo updates from [`TextInput::on_change_sync`] when a two-way binding is active.
248+
#[derive(Component, Default)]
249+
struct LastSignalText(String);
250+
264251
fn queue_set_text_actions(
265252
text_input_queue: &mut TextInputQueue,
266253
text: String,

0 commit comments

Comments
 (0)