Expand description
GPUI Kit bindings for the portable gpui-ce-motion animation engine.
This adapter uses Kit’s GPUI types. It does not enable the core crate’s CE feature, and it does not change either renderer. Retain one state per logical object, declare its destination during render, and notify after input changes.
use gpui_ce_motion::{Motion, Target};
use gpui_motion_kit::MotionState;
use gpui_kit::{AnyElement, App, Window, div, prelude::*};
fn panel(state: &mut MotionState, open: bool, window: &mut Window, cx: &App) -> AnyElement {
let frame = state.frame(Motion::new(Target::default()).present(open), window, cx);
frame.render(|frame| frame.apply(div().child("Details")))
}Re-exports§
pub use gpui_ce_motion as core;
Structs§
- Frame
- A sampled frame with Kit-native element builders and portable status getters.
- Layout
Group - A view-owned coordinate scope for automatic position-only layout animation. Clone shares the ancestor scope; retain one group across renders and use that same group for nested animated elements. Independent groups should not nest. Element history is owned by Kit’s keyed element state and lasts while mounted.
- Layout
Position Element - Transparent native wrapper produced by
LayoutGroup::position. Its child’s paint, hitboxes and accessibility bounds receive the same prepaint translation. No scale/rotation, size projection, or cross-parent shared IDs. - Motion
State - View-owned motion state using GPUI Kit’s monotonic executor clock.
- Number
Element - Styled count declaration. Number formatting reserves at most 256 minimum digits.
- Number
Motion State - Retained count animation. Unchanged digits match by place value, from the right.
- Scramble
- Deterministic visual substitutions. The logical accessibility text is unchanged.
- Text
Element - Styled native text declaration created by
TextMotionState::element. Layout takes destination sizes immediately; usereflowfor position motion. This is display text, not an editable or selectable input implementation. - Text
Motion State - View-owned native text motion. Clones share lifecycle and shape caches. Retain one state per logical label, with one mounted element per state. Fonts and full runs are shaped before splitting; native glyph atlas painting preserves kerning, contextual forms, bidi positions, and emoji.
- Text
Target - Text-relative offsets, opacity, and horizontal reveal fraction. Builders panic on non-finite offsets or fractions outside zero through one.
- Text
Unit Info - Metadata supplied once when preparing each unit’s custom entrance.
- Value
State - A retained scalar presentation in caller-chosen units.
- Vector
Element - Fixed-size native vector drawing. This paints vector geometry, not an SVG sprite or a GPUI subtree; it does not install pointer semantics.
- Vector
State - Retain one vector state per drawing. Clones share morph/reveal storage. Path sampling allocates no memory; native tessellation/paint preparation does.
Enums§
- Number
Effect - Digit transitions. Rolling and sliding retain unchanged digits by place value.
- Text
Clip - Stationary clipping around each unit’s final layout reservation.
- Text
Error - Native text failures, independent of the chosen GPUI backend.
- Text
Match - Identity policy when the requested text changes.
- Text
Preset - Convenience effects. A subsequent
enterorexitoverrides that target. - Text
Unit - Grouping for text motion. Native adapters merge boundaries inside shaped clusters.