Ward

A Ward on Foldkit (ADR-0071): the types of what a w.* element and the w.attributes bundle take. Wardic's attributes are a type of their own, beside Foldkit's Attribute<Message>, which is a closed Data.TaggedEnum (#791, Q6): a w.* element takes both, and h.div takes Foldkit's alone, so a Wardic attribute given to a plain element is a type error.

Interfaces

Attribute

A Wardic attribute: what w.Initial(…), w.Animate(…), w.Transition(…), w.Style(…) and w.Provider(…) return, for a w.* element's attribute list. The last of a repeated one wins, as Foldkit's second h.Style replaces the first.

Properties

[TypeId]
readonly [TypeId]: Key | "provider";
value
readonly value: unknown;

Bundle

What w.attributes(bundle) takes: an element's Config, and the element's own Mount, which the bundle fuses with Wardic's, since a second h.OnMount replaces the first on Foldkit 0.170 and throws on its preview (ADR-0071, decision 18).

Extends

Type Parameters

Message

Message

Properties

animate
animate: WardConfig;
Inherited from

Config.animate

animationComplete?
readonly animationComplete?: Handler<Message, WardicAnimationDefinition>;

w.OnAnimationComplete(…): sent as it lands, once every value it moves has settled; not for one a new target interrupted.

Inherited from

Config.animationComplete

animationScope?
readonly animationScope?: AnimationScope;

w.AnimationScope(scope): the element is the scope's: a Command's selectors given the scope resolve inside it, and its release stops the animations started in it.

Inherited from

Config.animationScope

animationStart?
readonly animationStart?: Handler<Message, WardicAnimationDefinition>;

w.OnAnimationStart(…): sent as an animation of the element starts (Motion's onAnimationStart).

Inherited from

Config.animationStart

appear
appear: WardConfig;
Inherited from

Config.appear

config?
readonly config?: ConfigOptions;

w.Config(…): the subtree's settings, this element's included.

Inherited from

Config.config

custom
custom: WardConfig;
Inherited from

Config.custom

drag
drag: WardConfig;
Inherited from

Config.drag

dragConstraints?
readonly dragConstraints?: any;

w.DragConstraints(…): where the element can be dragged to (Motion's dragConstraints, in Foldkit's forms).

Inherited from

Config.dragConstraints

dragControls
dragControls: WardConfig;
Inherited from

Config.dragControls

dragDirectionLock
dragDirectionLock: WardConfig;
Inherited from

Config.dragDirectionLock

dragElastic
dragElastic: WardConfig;
Inherited from

Config.dragElastic

dragListener
dragListener: WardConfig;
Inherited from

Config.dragListener

dragMomentum
dragMomentum: WardConfig;
Inherited from

Config.dragMomentum

dragPropagation
dragPropagation: WardConfig;
Inherited from

Config.dragPropagation

dragSnapToOrigin
dragSnapToOrigin: WardConfig;
Inherited from

Config.dragSnapToOrigin

dragTransition
dragTransition: WardConfig;
Inherited from

Config.dragTransition

exit
exit: WardConfig;
Inherited from

Config.exit

inherit
inherit: WardConfig;
Inherited from

Config.inherit

initial
initial: WardConfig;
Inherited from

Config.initial

key?
readonly key?: string;

The element's key, as w.keyed(tag)(key, …) gave it: what a child re-entering a presence during its exit takes over its leaver by (#286).

Inherited from

Config.key

layout
layout: WardConfig;
Inherited from

Config.layout

layoutAnimationComplete?
readonly layoutAnimationComplete?: Handler<Message, void>;

w.OnLayoutAnimationComplete(…): sent once it has landed (Motion's onLayoutAnimationComplete).

Inherited from

Config.layoutAnimationComplete

layoutAnimationStart?
readonly layoutAnimationStart?: Handler<Message, void>;

w.OnLayoutAnimationStart(…): sent at the frame a layout animation's first step is painted (Motion's onLayoutAnimationStart).

Inherited from

Config.layoutAnimationStart

layoutCrossfade
layoutCrossfade: WardConfig;
Inherited from

Config.layoutCrossfade

layoutDependency
layoutDependency: WardConfig;
Inherited from

Config.layoutDependency

layoutGroup?
readonly layoutGroup?: LayoutGroupOptions;

w.LayoutGroup(…): the namespace of the layoutIds under the element (decision 30).

Inherited from

Config.layoutGroup

layoutId
layoutId: WardConfig;
Inherited from

Config.layoutId

layoutRoot
layoutRoot: WardConfig;
Inherited from

Config.layoutRoot

layoutScroll
layoutScroll: WardConfig;
Inherited from

Config.layoutScroll

mount?
readonly mount?: Readonly<{
}>;
onBeforeLayoutMeasure
onBeforeLayoutMeasure: WardConfig;
Inherited from

Config.onBeforeLayoutMeasure

onDirectionLock?
readonly onDirectionLock?: Handler<Message, "x" | "y">;

w.OnDirectionLock(…): with DragDirectionLock, sent with the axis a drag locked to, before OnDragStart (Motion's onDirectionLock).

Inherited from

Config.onDirectionLock

onDrag?
readonly onDrag?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDrag(…): sent as the drag moves, at its start and each move after (Motion's onDrag).

Inherited from

Config.onDrag

onDragEnd?
readonly onDragEnd?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDragEnd(…): sent as the drag is let go; not for one its controls cancelled (Motion's onDragEnd).

Inherited from

Config.onDragEnd

onDragStart?
readonly onDragStart?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDragStart(…): sent as a drag of the element starts, past its threshold (Motion's onDragStart).

Inherited from

Config.onDragStart

onDragTransitionEnd?
readonly onDragTransitionEnd?: Handler<Message, void>;

w.OnDragTransitionEnd(…): sent as the element comes to rest after it's let go; not when a new grab stops it (Motion's onDragTransitionEnd).

Inherited from

Config.onDragTransitionEnd

onHoverEnd?
readonly onHoverEnd?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnHoverEnd(…): sent as it leaves (Motion's onHoverEnd).

Inherited from

Config.onHoverEnd

onHoverStart?
readonly onHoverStart?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnHoverStart(…): sent as the pointer comes over the element (Motion's onHoverStart; a touch never hovers).

Inherited from

Config.onHoverStart

onLayoutMeasure
onLayoutMeasure: WardConfig;
Inherited from

Config.onLayoutMeasure

onMeasureDragConstraints
onMeasureDragConstraints: WardConfig;
Inherited from

Config.onMeasureDragConstraints

onPan?
readonly onPan?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPan(…): sent as the pan moves, at its start and each move after (Motion's onPan).

Inherited from

Config.onPan

onPanEnd?
readonly onPanEnd?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPanEnd(…): sent as a pan that started ends, or is cancelled (Motion's onPanEnd).

Inherited from

Config.onPanEnd

onPanSessionStart?
readonly onPanSessionStart?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnPanSessionStart(…): sent as a pointer goes down on the element, ready to pan, with its point (Motion's onPanSessionStart).

Inherited from

Config.onPanSessionStart

onPanStart?
readonly onPanStart?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPanStart(…): sent as a pan starts, past its threshold (Motion's onPanStart).

Inherited from

Config.onPanStart

onTap?
readonly onTap?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTap(…): sent as that press ends on the element, or its key comes up (Motion's onTap).

Inherited from

Config.onTap

onTapCancel?
readonly onTapCancel?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTapCancel(…): sent as that press ends elsewhere, or is cancelled; a press a drag took over is neither (Motion's onTapCancel).

Inherited from

Config.onTapCancel

onTapStart?
readonly onTapStart?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTapStart(…): sent as a press begins, a pointer's down or Enter or Space while focused (Motion's onTapStart).

Inherited from

Config.onTapStart

onUpdate?
readonly onUpdate?: Writable<Values, Values>;

w.OnUpdate(atom): set to the element's values each committed frame (decision 24, Motion's onUpdate).

Inherited from

Config.onUpdate

onViewportEnter?
readonly onViewportEnter?: Handler<Message, IntersectionObserverEntry>;

w.OnViewportEnter(…): sent as the element comes into view, with the browser's entry (Motion's onViewportEnter).

Inherited from

Config.onViewportEnter

onViewportLeave?
readonly onViewportLeave?: Handler<Message, IntersectionObserverEntry>;

w.OnViewportLeave(…): sent as it leaves the view; never after the first entry under once (Motion's onViewportLeave).

Inherited from

Config.onViewportLeave

presence?
readonly presence?: PresenceOptions<Message>;

w.Presence(…): the element's children exit before they're removed (decision 29).

Inherited from

Config.presence

propagate
propagate: WardConfig;
Inherited from

Config.propagate

reorderGroup?
readonly reorderGroup?: ReorderGroupOptions<Message, unknown>;

w.ReorderGroup(…): the element is a Reorder group, its keyed w.ReorderItem children the items (decision 28); read over any V.

Inherited from

Config.reorderGroup

reorderItem?
readonly reorderItem?: ReorderItem;

w.ReorderItem(value): the element is an item of the group above it.

Inherited from

Config.reorderItem

startsDrag?
readonly startsDrag?: StartsDrag;

w.StartsDrag(…): a pointer pressed on this element starts the controls' drags.

Inherited from

Config.startsDrag

style?
readonly style?: Style;
Inherited from

Config.style

text?
readonly text?: Atom<string | number>;

w.Text(atom): the element's text, written outside the patch as the Atom changes (decision 16).

Inherited from

Config.text

transformTemplate?
readonly transformTemplate?: any;

w.TransformTemplate(fn): the element's transform from its values and the generated string (Motion's). Hoist it: it's followed by reference.

Inherited from

Config.transformTemplate

transition
transition: WardConfig;
Inherited from

Config.transition

variants
variants: WardConfig;
Inherited from

Config.variants

viewport?
readonly viewport?: ViewportOptions;

w.Viewport(…): what "in view" means (Motion's viewport).

Inherited from

Config.viewport

whileDrag
whileDrag: WardConfig;
Inherited from

Config.whileDrag

whileFocus
whileFocus: WardConfig;
Inherited from

Config.whileFocus

whileHover
whileHover: WardConfig;
Inherited from

Config.whileHover

whileInView
whileInView: WardConfig;
Inherited from

Config.whileInView

whileTap
whileTap: WardConfig;
Inherited from

Config.whileTap


Config

An element's config: where it starts, where it animates to, how, where it exits to, its layout, and its style, whose values are its base values (dom's WardConfig's, Motion's props). Each key is typed on its own (#791, Q17): nothing is inferred across attributes.

Extends

  • Pick<WardConfig.WardConfig, | "initial" | "animate" | "transition" | "variants" | "custom" | "inherit" | "appear" | "exit" | "layout" | "layoutId" | "layoutDependency" | "layoutScroll" | "layoutRoot" | "layoutCrossfade" | "onBeforeLayoutMeasure" | "onLayoutMeasure" | "whileHover" | "whileTap" | "propagate" | "whileFocus" | "whileInView" | "drag" | "whileDrag" | "dragElastic" | "dragMomentum" | "dragSnapToOrigin" | "dragTransition" | "dragPropagation" | "dragDirectionLock" | "dragListener" | "dragControls" | "onMeasureDragConstraints">

Extended by

Type Parameters

Message

Message = never

Properties

animate
animate: WardConfig;
Inherited from

Pick.animate

animationComplete?
readonly animationComplete?: Handler<Message, WardicAnimationDefinition>;

w.OnAnimationComplete(…): sent as it lands, once every value it moves has settled; not for one a new target interrupted.

animationScope?
readonly animationScope?: AnimationScope;

w.AnimationScope(scope): the element is the scope's: a Command's selectors given the scope resolve inside it, and its release stops the animations started in it.

animationStart?
readonly animationStart?: Handler<Message, WardicAnimationDefinition>;

w.OnAnimationStart(…): sent as an animation of the element starts (Motion's onAnimationStart).

appear
appear: WardConfig;
Inherited from

Pick.appear

config?
readonly config?: ConfigOptions;

w.Config(…): the subtree's settings, this element's included.

custom
custom: WardConfig;
Inherited from

Pick.custom

drag
drag: WardConfig;
Inherited from

Pick.drag

dragConstraints?
readonly dragConstraints?: any;

w.DragConstraints(…): where the element can be dragged to (Motion's dragConstraints, in Foldkit's forms).

dragControls
dragControls: WardConfig;
Inherited from

Pick.dragControls

dragDirectionLock
dragDirectionLock: WardConfig;
Inherited from

Pick.dragDirectionLock

dragElastic
dragElastic: WardConfig;
Inherited from

Pick.dragElastic

dragListener
dragListener: WardConfig;
Inherited from

Pick.dragListener

dragMomentum
dragMomentum: WardConfig;
Inherited from

Pick.dragMomentum

dragPropagation
dragPropagation: WardConfig;
Inherited from

Pick.dragPropagation

dragSnapToOrigin
dragSnapToOrigin: WardConfig;
Inherited from

Pick.dragSnapToOrigin

dragTransition
dragTransition: WardConfig;
Inherited from

Pick.dragTransition

exit
exit: WardConfig;
Inherited from

Pick.exit

inherit
inherit: WardConfig;
Inherited from

Pick.inherit

initial
initial: WardConfig;
Inherited from

Pick.initial

key?
readonly key?: string;

The element's key, as w.keyed(tag)(key, …) gave it: what a child re-entering a presence during its exit takes over its leaver by (#286).

layout
layout: WardConfig;
Inherited from

Pick.layout

layoutAnimationComplete?
readonly layoutAnimationComplete?: Handler<Message, void>;

w.OnLayoutAnimationComplete(…): sent once it has landed (Motion's onLayoutAnimationComplete).

layoutAnimationStart?
readonly layoutAnimationStart?: Handler<Message, void>;

w.OnLayoutAnimationStart(…): sent at the frame a layout animation's first step is painted (Motion's onLayoutAnimationStart).

layoutCrossfade
layoutCrossfade: WardConfig;
Inherited from

Pick.layoutCrossfade

layoutDependency
layoutDependency: WardConfig;
Inherited from

Pick.layoutDependency

layoutGroup?
readonly layoutGroup?: LayoutGroupOptions;

w.LayoutGroup(…): the namespace of the layoutIds under the element (decision 30).

layoutId
layoutId: WardConfig;
Inherited from

Pick.layoutId

layoutRoot
layoutRoot: WardConfig;
Inherited from

Pick.layoutRoot

layoutScroll
layoutScroll: WardConfig;
Inherited from

Pick.layoutScroll

onBeforeLayoutMeasure
onBeforeLayoutMeasure: WardConfig;
Inherited from

Pick.onBeforeLayoutMeasure

onDirectionLock?
readonly onDirectionLock?: Handler<Message, "x" | "y">;

w.OnDirectionLock(…): with DragDirectionLock, sent with the axis a drag locked to, before OnDragStart (Motion's onDirectionLock).

onDrag?
readonly onDrag?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDrag(…): sent as the drag moves, at its start and each move after (Motion's onDrag).

onDragEnd?
readonly onDragEnd?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDragEnd(…): sent as the drag is let go; not for one its controls cancelled (Motion's onDragEnd).

onDragStart?
readonly onDragStart?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnDragStart(…): sent as a drag of the element starts, past its threshold (Motion's onDragStart).

onDragTransitionEnd?
readonly onDragTransitionEnd?: Handler<Message, void>;

w.OnDragTransitionEnd(…): sent as the element comes to rest after it's let go; not when a new grab stops it (Motion's onDragTransitionEnd).

onHoverEnd?
readonly onHoverEnd?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnHoverEnd(…): sent as it leaves (Motion's onHoverEnd).

onHoverStart?
readonly onHoverStart?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnHoverStart(…): sent as the pointer comes over the element (Motion's onHoverStart; a touch never hovers).

onLayoutMeasure
onLayoutMeasure: WardConfig;
Inherited from

Pick.onLayoutMeasure

onMeasureDragConstraints
onMeasureDragConstraints: WardConfig;
Inherited from

Pick.onMeasureDragConstraints

onPan?
readonly onPan?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPan(…): sent as the pan moves, at its start and each move after (Motion's onPan).

onPanEnd?
readonly onPanEnd?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPanEnd(…): sent as a pan that started ends, or is cancelled (Motion's onPanEnd).

onPanSessionStart?
readonly onPanSessionStart?: GestureHandler<Message, PointerEvent, WardicPointInfo>;

w.OnPanSessionStart(…): sent as a pointer goes down on the element, ready to pan, with its point (Motion's onPanSessionStart).

onPanStart?
readonly onPanStart?: GestureHandler<Message, PointerEvent, WardicDragInfo>;

w.OnPanStart(…): sent as a pan starts, past its threshold (Motion's onPanStart).

onTap?
readonly onTap?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTap(…): sent as that press ends on the element, or its key comes up (Motion's onTap).

onTapCancel?
readonly onTapCancel?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTapCancel(…): sent as that press ends elsewhere, or is cancelled; a press a drag took over is neither (Motion's onTapCancel).

onTapStart?
readonly onTapStart?: GestureHandler<Message, WardicPressEvent, WardicPressInfo>;

w.OnTapStart(…): sent as a press begins, a pointer's down or Enter or Space while focused (Motion's onTapStart).

onUpdate?
readonly onUpdate?: Writable<Values, Values>;

w.OnUpdate(atom): set to the element's values each committed frame (decision 24, Motion's onUpdate).

onViewportEnter?
readonly onViewportEnter?: Handler<Message, IntersectionObserverEntry>;

w.OnViewportEnter(…): sent as the element comes into view, with the browser's entry (Motion's onViewportEnter).

onViewportLeave?
readonly onViewportLeave?: Handler<Message, IntersectionObserverEntry>;

w.OnViewportLeave(…): sent as it leaves the view; never after the first entry under once (Motion's onViewportLeave).

presence?
readonly presence?: PresenceOptions<Message>;

w.Presence(…): the element's children exit before they're removed (decision 29).

propagate
propagate: WardConfig;
Inherited from

Pick.propagate

reorderGroup?
readonly reorderGroup?: ReorderGroupOptions<Message, unknown>;

w.ReorderGroup(…): the element is a Reorder group, its keyed w.ReorderItem children the items (decision 28); read over any V.

reorderItem?
readonly reorderItem?: ReorderItem;

w.ReorderItem(value): the element is an item of the group above it.

startsDrag?
readonly startsDrag?: StartsDrag;

w.StartsDrag(…): a pointer pressed on this element starts the controls' drags.

style?
readonly style?: Style;
text?
readonly text?: Atom<string | number>;

w.Text(atom): the element's text, written outside the patch as the Atom changes (decision 16).

transformTemplate?
readonly transformTemplate?: any;

w.TransformTemplate(fn): the element's transform from its values and the generated string (Motion's). Hoist it: it's followed by reference.

transition
transition: WardConfig;
Inherited from

Pick.transition

variants
variants: WardConfig;
Inherited from

Pick.variants

viewport?
readonly viewport?: ViewportOptions;

w.Viewport(…): what "in view" means (Motion's viewport).

whileDrag
whileDrag: WardConfig;
Inherited from

Pick.whileDrag

whileFocus
whileFocus: WardConfig;
Inherited from

Pick.whileFocus

whileHover
whileHover: WardConfig;
Inherited from

Pick.whileHover

whileInView
whileInView: WardConfig;
Inherited from

Pick.whileInView

whileTap
whileTap: WardConfig;
Inherited from

Pick.whileTap


ConfigOptions

A subtree's settings (ADR-0062, Motion's MotionConfig; ADR-0071 decision 22): w.Config(…) on an element, over the nearest ancestor's, over the Handle's config. Each is read when an animation starts, so a change moves nothing by itself.

Properties

reducedMotion?
readonly reducedMotion?: any;

Reduced motion (ADR-0029): "user" follows the preference, "always" and "never" decide.

skipAnimations?
readonly skipAnimations?: boolean;

Whether every animation lands at once (#468, Motion's MotionGlobalConfig.skipAnimations for a subtree).

transformPagePoint?
readonly transformPagePoint?: any;

Where a drag's and a pan's points are (Motion's transformPagePoint; #793, Q9): a point in the viewport, mapped to the one the gesture uses, applied to its every point and to the boxes a DragConstraints container is measured against. Read at each pointer down.

transition?
readonly transition?: any;

The Config transition: what an element with no transition of its own runs on.


LayoutGroupOptions

w.LayoutGroup(options)'s options (#432; Motion's LayoutGroup, ADR-0071 decision 22): a namespace for the layoutIds under the element, read once as the first of them mounts.

Properties

id?
readonly id?: string;

An id put before every layoutId under it: under { id: "tabs" }, a LayoutId("underline") is tabs-underline.

inherit?
readonly inherit?: any;

Whether it joins the id of the group above it: true (the default) and "id" both do, outer-inner; false starts afresh.


PresenceOptions

w.Presence(options)'s options (ADR-0071 decision 29; Motion's AnimatePresence props, @wardic/solid's AnimatePresence's), on the leavers' parent. Each is read as it's needed: mode and presenceAffectsLayout at each change, custom and the anchors as a child leaves, initial as a child mounts, propagate once.

Type Parameters

Message

Message = never

Properties

anchorX?
readonly anchorX?: any;

Where "popLayout" pins a leaver (Motion's): by its inline start or end; the start by default.

anchorY?
readonly anchorY?: any;

Where "popLayout" pins a leaver: by its top or bottom; the top by default.

custom?
readonly custom?: unknown;

What a leaving child's dynamic Exit resolves with (Motion's custom), over the child's own Custom.

initial?
readonly initial?: boolean;

false: the children present at the presence's first render start at their Animate; one entering later animates in (Motion's initial).

mode?
readonly mode?: any;

How a change with a leaver goes: "sync" (the default), the entering child beside the leaver at once; "popLayout", the leaver popped out of the flow where it was, so its siblings take their places at once; "wait", the entering child held off the page, hidden, until the last leaver is gone.

onExitComplete?
readonly onExitComplete?: Handler<Message, void>;

Sent once every leaver has animated out and been removed, the last by completing (Motion's onExitComplete). Not under replay.

presenceAffectsLayout?
readonly presenceAffectsLayout?: boolean;

Whether a child's going and coming moves the layout elements around it (Motion's prop); true by default.

propagate?
readonly propagate?: boolean;

Motion's propagate: inside another presence's child, when that child leaves, these children all leave too, and it goes once they've gone.


ProviderOptions

w.Provider(options)'s options (#791, Q16): none in slice 1. Slice 2's layoutTrigger and what comes after join here, so the attribute's shape doesn't change.


ReorderGroupOptions

w.ReorderGroup(options)'s options (ADR-0020; ADR-0071 decision 28; #793, Q11): the list's values in order, from the Model, and the Messages its reorders send. V is inferred from values.

Type Parameters

Message

Message

V

V

Properties

announcements?
readonly announcements?: any;

The announcements over the English defaults.

axis?
readonly axis?: any;

The list's direction; left out, found from the items' boxes.

instructions?
readonly instructions?: string;

What each item's aria-describedby reads, over the English default.

keyboard?
readonly keyboard?: boolean;

The Keyboard reorder (ADR-0037): on unless false. Off, the items have no keys, no tab stop and no instructions.

onHoldEnd?
readonly onHoldEnd?: Handler<Message, HoldEnd<V>>;

Sent once as an item in hand is let go, however: after onReorderEnd when it moved.

onHoldStart?
readonly onHoldStart?: Handler<Message, HoldStart<V>>;

Sent as an item is taken in hand: a drag past its threshold (not the press), or a keyboard lift.

onReorder
readonly onReorder: Handler<Message, V[]>;

Sent with the whole new order at each Crossover (Q12): set the Model's values from it.

onReorderEnd?
readonly onReorderEnd?: Handler<Message, End<V>>;

Sent once at the end of a reorder that changed the order: a drag let go, or a keyboard lift dropped; not a cancel. What an app saves.

values
readonly values: readonly V[];

The list's values, in order: the Model's.


ReorderItem

w.ReorderItem(value): the item's value in its group's values, read once at mount.

Properties

value
readonly value: unknown;

StartsDrag

w.StartsDrag(controls, options) (#793, Q8): a pointer pressed on the element starts the controls' drags, with options.

Properties

controls
readonly controls: WardicDragControls;
options?
readonly options?: any;

ViewportOptions

w.Viewport(options)'s options (Motion's viewport; #793, Q16): what "in view" means for WhileInView and the viewport callbacks, read as the recognizer starts.

Properties

amount?
readonly amount?: number | "some" | "all";

How much of the element must show: "some" (the default), "all", or 0 to 1.

margin?
readonly margin?: string;

Grown around the root, as CSS rootMargin: "0px 0px -100px 0px" counts it in 100 px later at the bottom.

once?
readonly once?: boolean;

Stays in view after its first entry.

root?
readonly root?: string;

The scrolling container it's in view of: "parent", the element's parent, or a selector, resolved under the w.Provider() element, else the document, as the recognizer starts; the window if none.

Type Aliases

AnimationDefinition

type AnimationDefinition = CoreConfig.WardicAnimationDefinition;

What w.OnAnimationStart and w.OnAnimationComplete are told: the variant name, or the values, the animation went to (Motion's).


BoundingBox

type BoundingBox = DomDragConstraints.WardicBoundingBox;

A box's edges (Motion's BoundingBox): on x, left and right; on y, top and bottom.


Callback

type Callback<Message, Args> = Message | ((...args) => Message | Option.Option<Message>);

A callback as a Message (ADR-0071, decision 23), in Foldkit's two handler shapes: a Message, sent as it is, or a function of what the callback is told, giving a Message, or an Option of one, where Option.none() sends nothing.

Type Parameters

Message

Message

Args

Args extends ReadonlyArray<unknown>


Child

type Child = Html | string;

A w.* element's child, as h.div's: an element, nothing, or text.


DragConstraints

type DragConstraints = false | Partial<BoundingBox> | string;

w.DragConstraints(…) (Motion's dragConstraints; #793, Q7): a box in pixels from where the element started, an edge left out unbounded; "parent", the element's parent; a selector, resolved under the w.Provider() element, else the document, at each measure (a drag's start, a resize of either); or false, none. A Fling past an edge springs back to it.


DragControls

type DragControls = DomDragControls.WardicDragControls;

The Drag controls DragControls.make() gives (Motion's useDragControls).


DragInfo

type DragInfo = GestureInfo.WardicDragInfo;

A drag's or a pan's info (Motion's PanInfo): where the pointer is, in the viewport, its offset from the down, its last delta and its velocity in px/s. A one-axis drag's are zeroed off its axis.


GestureHandler

type GestureHandler<Message, Raw, Info> = Callback<Message, [event: Raw, info: Info]>;

A gesture Callback (decision 23; ADR-0047's (event, info)): told the platform's event (Raw) and the gesture's info. The function runs at the event, inside the recognizer's dispatch, so stopPropagation() and preventDefault() do what they say; its Message reaches update a microtask later.

Type Parameters

Message

Message

Raw

Raw

Info

Info


Handler

type Handler<Message, A> = Callback<Message, [value: A]>;

A Callback told one value: the animation, layout and viewport callbacks', and a presence's onExitComplete.

Type Parameters

Message

Message

A

A


Key

type Key = 
  | "initial"
  | "animate"
  | "appear"
  | "transition"
  | "style"
  | "variants"
  | "custom"
  | "inherit"
  | "config"
  | "animationStart"
  | "animationComplete"
  | "text"
  | "onUpdate"
  | "transformTemplate"
  | "exit"
  | "presence"
  | "key"
  | "layout"
  | "layoutId"
  | "layoutDependency"
  | "layoutScroll"
  | "layoutRoot"
  | "layoutCrossfade"
  | "layoutGroup"
  | "layoutAnimationStart"
  | "layoutAnimationComplete"
  | "onBeforeLayoutMeasure"
  | "onLayoutMeasure"
  | "whileHover"
  | "onHoverStart"
  | "onHoverEnd"
  | "whileTap"
  | "propagate"
  | "onTapStart"
  | "onTap"
  | "onTapCancel"
  | "whileFocus"
  | "whileInView"
  | "viewport"
  | "onViewportEnter"
  | "onViewportLeave"
  | "drag"
  | "whileDrag"
  | "dragConstraints"
  | "dragElastic"
  | "dragMomentum"
  | "dragSnapToOrigin"
  | "dragTransition"
  | "dragPropagation"
  | "dragDirectionLock"
  | "dragListener"
  | "dragControls"
  | "startsDrag"
  | "onMeasureDragConstraints"
  | "onDragStart"
  | "onDrag"
  | "onDragEnd"
  | "onDragTransitionEnd"
  | "onDirectionLock"
  | "onPanSessionStart"
  | "onPanStart"
  | "onPan"
  | "onPanEnd"
  | "reorderGroup"
  | "reorderItem"
  | "animationScope";

The keys of an element's config a Wardic attribute sets (slices 1 to 3's; the rest come with the later slices).


Latest

type Latest = Values.Values;

What w.OnUpdate(atom) sets each committed frame: the element's values before projection, a copy per frame (#791, Q6).


PointInfo

type PointInfo = GestureInfo.WardicPointInfo;

A hover's info (Motion's EventInfo): where the pointer was, in the viewport.


PressEvent

type PressEvent = GestureInfo.WardicPressEvent;

The platform's event a press callback is told: a pointer's, a Keyboard press's key, or the blur that cancelled it.


PressInfo

type PressInfo = GestureInfo.WardicPressInfo;

A press's info (Motion's TapInfo): where it was, in the viewport, and whether a pointer or the keyboard made it.


ReorderAnnouncements

type ReorderAnnouncements<V> = Partial<CoreReorder.Announcements<V>>;

What a screen reader hears at each step of a Keyboard reorder, over the English defaults (ADR-0037).

Type Parameters

V

V


ReorderAxis

type ReorderAxis = CoreReorder.Axis;

A Reorder group's direction (core's): "y", a column; "x", a row; "xy", a grid that wraps.


ReorderEnd

type ReorderEnd<V> = ReorderController.End<V>;

A reorder that changed the order, at its end (Motion-free, #257 item 3): the order, the item that moved, its index from and to.

Type Parameters

V

V


ReorderHoldEnd

type ReorderHoldEnd<V> = ReorderController.HoldEnd<V>;

A Reorder hold's end (#348), once, however it ended: how is "drop", "cancel" or "unmount".

Type Parameters

V

V


ReorderHoldStart

type ReorderHoldStart<V> = ReorderController.HoldStart<V>;

A Reorder hold's start (#348): the item taken in hand, by a drag's start or a keyboard lift, and its index then.

Type Parameters

V

V


StartOptions

type StartOptions = DomDragControls.WardicDragControlsOptions;

controls.start's options, as w.StartsDrag(controls, options) gives them: snapToCursor and distanceThreshold.


Style

type Style = { readonly [K in keyof WardConfig.WardicValues]?: WardConfig.WardicValues[K] | Atom.Atom<WardConfig.WardicValues[K]> };

An element's style as Wardic sees it (Motion's style): every CSS property and the transform keys (x, scale, rotate, …), each a value or a Live value, an effect/reactivity Atom, followed through the gate (ADR-0043). A value is the element's base value, where a key returns when nothing animates it. Atoms alone are Live here (#791, Q4): a function is a development error.


TypeId

type TypeId = typeof TypeId;

The mark of a Wardic attribute: a symbol, so no Foldkit _tag is ever mistaken for one.

Variables

TypeId

const TypeId: unique symbol;

The mark of a Wardic attribute: a symbol, so no Foldkit _tag is ever mistaken for one.

Functions

isAttribute()

function isAttribute(value): value is Attribute;

Whether value is a Wardic attribute.

Parameters

value

unknown

Returns

value is Attribute