@wardic/core
Effect-typed: this package uses Effect's own types, so it moves to a new Effect major only in a Wardic major (the roadmap).
Wardic's engine: animations, gestures, layout projection and the services an Environment provides, free of any framework or platform. Each module is @wardic/core/<Module>, and each page is generated from its source's doc comments.
| Module | |
|---|---|
| Announcer | The Announcer: how an Environment speaks a message to assistive technology, a screen reader, say. |
| Arc | Curved paths between two points, for a transition's path: x and y travel along the curve together, rather than each on a straight line. |
| AutoScroll | Auto-scroll for a Reorder group, as Motion's: while an item is dragged near a scroller's edge, the scroller scrolls toward it, faster the nearer. |
| BaseValue | Where a key starts, and where it returns: an element's Base value for a key is the first of its base target (its animate, else an inherited variant, else its initial), its initial, its own style, the values it started at, and its Own value, which its Environment reads off it. |
| Box | Boxes as layout projection works with them: two axes, each the interval it spans, { min, max }, so every projection formula is one function per axis, applied twice. |
| Clock | The Clock: the engine's time. |
| DefaultTransition | What a key runs on when its own transition isn't defined. |
| Drag | A drag's samples and what shapes them: Sample, what DragRecognizer's drags give at each step; Axis, the axes one moves on; and the constraints a binding applies to a sample's offset, with a rubber band past them (constrain, within, withinBounds), or to keep an element inside a container (boundsWithin, keepPlace after a resize). |
| DragActivity | Drag activity: how many drags are active, and which element holds each axis. |
| DragRecognizer | The pointer's drags and pans. |
| Easing | Easings: a tween's curve, from its progress in time to its progress along the way, each a function of t from 0 to 1. |
| Frame | Frames: what an animation gives each tick, its value and whether it has settled; its last Frame is done: true. |
| FrameLoop | The Frame loop: the one loop per Environment that steps every running animation once a tick, in one pass, so many animations cost one loop and not a fiber each. |
| Inertia | An inertia as a stepper: a glide that carries a value on from its velocity and eases to a stop, as a flick or a drag's release does, springing back from min or max if it would pass one. |
| InputFeed | Input feeds: a target's input as an Environment gives it, event by event, inside the platform's own dispatch. |
| InputSource | Input from the Environment: the InputSource service, which gives each target's pointer, keys and focus as Input feeds, and the events they carry, in core's own terms, so no recognizer reads a platform's events. |
| Interpolator | The kinds of value Wardic blends: numbers, arrays of numbers, numbers with units ("10px"), and complex values, strings with numbers among other text, as a shadow's or a path's. |
| InterpolatorRegistry | The registry of value kinds: given two values, it finds the kind that blends them and returns the blend each frame calls. |
| LiveValue | Live values: values derived from other values as they change, each an effect/reactivity Atom an element's style can follow. |
| Machine | Machines: an animation as a value. |
| Microtask | The end of the current task: next waits for it, then goes on before any timer, frame or later task, the same on every platform. |
| Override | Gesture states laid over a base: an Override stack is a list of partial targets, each on or off, and resolve merges the ones that are on into one target, a later one's values winning. |
| Playback | A playhead the machines of one animation share, so they play, pause, seek, change speed or run backwards together: make one, drive each machine through it, then pause, play, setSpeed or seek it. |
| Point | A 2D point, { x, y }, or a vector, an offset or a velocity, and its geometry: distance, angle and lerp. |
| PressClaims | Press claims: the pointer downs and keys presses started from, and whether a press claimed one, so a press that doesn't propagate (Recognizer.press's propagate: false) keeps its ancestors' presses from starting on the same down. |
| Probe | The Probe: what an Environment can tell the engine about what it draws. |
| Projection | Layout projection's geometry, as Motion's: the Delta that maps one box onto another (calcBoxDelta), a delta applied to a box (applyBoxDelta), a box drawn through its ancestors' deltas (applyTreeDeltas), and a box relative to its parent's (calcRelativeBox, placeRelativeBox). |
| Recognizer | Recognizers: a gesture's state from an Environment's input. |
| ReducedMotion | Reduced motion, as Motion does it: under it, a run's positional keys, the transforms and an element's position and size, land where the run would end, and every other key, an opacity or a colour, animates as ever. |
| RefreshFrameSource | Where an Environment's Refresh frames come from: the frames its platform draws, each with its time. |
| Renderer | The Renderer: how an Environment writes animated values to what it draws, an element, a canvas context, a native view. |
| Reorder | Reorder groups: a list the user reorders by dragging an item, or with the keys, as Motion's Reorder.Group. |
| Scalar | Number helpers for animation code: lerp, inverseLerp, clamp, wrap, remap, damp and snap. |
| Sequence | Animation sequences, as Motion's: Segments laid out in time, compiled to one keyframes animation per subject and key, each stop placed in time over the whole sequence. |
| SharedSource | Shared sources, for the Streams an Environment hands out: each hot and counted, so however many subscribe, one underlying source runs, started by the first subscriber and stopped when the last one leaves. |
| Spring | Springs: presets to give Machine.spring or a transition, and a spring as a stepper (resolve, init, step) for something you step yourself each frame. |
| Stagger | Delays that grow across a set of children, from the first, the last, the centre or any index: what a transition's delayChildren: stagger() and createAnimate's delay run on. |
| Supersede | A token that ends many runs at once without interrupting them: give it to each run you might replace, Machine.run(machine, sink, { supersede: token }), then end it, and each run still going leaves the Frame loop and succeeds with Superseded, neither settled nor failed. |
| Values | Value bags: Values, a flat map of keys to numbers or strings, the shape every animation target takes, and what a binding does with one as it builds an animation: split it by kind, and pick from it. |
| Velocity | Velocity from samples: between for two values a frame apart, and trailing for a pointer's last 100 ms, as a drag's release reads it. |
| Wave | Values that change over time on their own: sine and pulse repeat, and noise wanders. |