DocsAPI referenceUI machinesreveal

reveal machine

The public state machine contract for @grassroot/ui-machines/reveal. The machine owns behaviour; the matching headless layer owns composition.

@grassroot/ui-machines/reveal

Package

14 exports
View source packages/ui-machines/src/reveal/index.ts

Service example

reveal.tsts
import { createService } from "@grassroot/statechart";
import { revealMachine } from "@grassroot/ui-machines/reveal";
const service = createService(revealMachine, { input: {} });
service.start();
service.send({ type: "…" });
service.stop();

Exports

DeclarationView source
REVEAL_BACKSTOP_DELAY_MSts
export declare const REVEAL_BACKSTOP_DELAY_MS: 1200;
DeclarationView source
REVEAL_BACKSTOP_KEYts
export declare const REVEAL_BACKSTOP_KEY: "reveal.backstop";
DeclarationView source
RevealCommandts
type RevealCommand = (CommandObject & {
readonly type: "OBSERVE_START";
}) | (CommandObject & {
readonly type: "OBSERVE_STOP";
}) | (CommandObject & {
readonly type: "REVEALED";
readonly reason: RevealReason;
}) | ScheduleCommand<RevealEvent> | CancelCommand;
DeclarationView source
RevealContextts
type RevealContext = {
readonly observing: boolean;
readonly backstopPending: boolean;
};
Name
Kind
Type
Requirement
backstopPending
property
boolean
required
observing
property
boolean
required
Name
backstopPending
Kind
property
Type
boolean
Requirement
required
Name
observing
Kind
property
Type
boolean
Requirement
required
DeclarationView source
RevealDiagnosticCodests
export declare const RevealDiagnosticCodes: readonly DiagnosticCatalogueEntry[];
DeclarationView source
RevealEventts
type RevealEvent = {
readonly type: "START";
} | {
readonly type: "VIEWPORT_INTERSECT";
} | {
readonly type: "BACKSTOP";
} | {
readonly type: "REVEAL";
} | {
readonly type: "STOP";
};
DeclarationView source
RevealInputts
type RevealInput = {
/** Controller-reported reduced-motion preference. Not a MediaQueryList. */
readonly prefersReducedMotion?: boolean;
/** Controller-reported IntersectionObserver support. */
readonly hasObserver?: boolean;
};
Name
Kind
Type
Requirement
Description
hasObserver
property
boolean
optional
Controller-reported IntersectionObserver support.
prefersReducedMotion
property
boolean
optional
Controller-reported reduced-motion preference. Not a MediaQueryList.
Name
hasObserver
Kind
property
Type
boolean
Requirement
optional
Description
Controller-reported IntersectionObserver support.
Name
prefersReducedMotion
Kind
property
Type
boolean
Requirement
optional
Description
Controller-reported reduced-motion preference. Not a MediaQueryList.
DeclarationView source
revealMachinets
export declare const revealMachine: RevealMachine;
DeclarationView source
RevealMachinets
type RevealMachine = Machine<RevealInput, RevealStateValue, RevealContext, RevealEvent, RevealCommand>;
DeclarationView source
RevealReasonts
type RevealReason = "immediate" | "intersection" | "backstop" | "manual";
DeclarationView source
revealReplaySequencets
export declare const revealReplaySequence: readonly RevealEvent[];
DeclarationView source
revealSelectorsts
export declare const revealSelectors: {
shown: (snapshot: RevealSnapshot) => boolean;
observing: (snapshot: RevealSnapshot) => boolean;
backstopPending: (snapshot: RevealSnapshot) => boolean;
};
Name
Kind
Type
Requirement
backstopPending
property
(snapshot: RevealSnapshot) => boolean
required
observing
property
(snapshot: RevealSnapshot) => boolean
required
shown
property
(snapshot: RevealSnapshot) => boolean
required
Name
backstopPending
Kind
property
Type
(snapshot: RevealSnapshot) => boolean
Requirement
required
Name
observing
Kind
property
Type
(snapshot: RevealSnapshot) => boolean
Requirement
required
Name
shown
Kind
property
Type
(snapshot: RevealSnapshot) => boolean
Requirement
required
DeclarationView source
RevealSnapshotts
type RevealSnapshot = Snapshot<RevealStateValue, RevealContext>;
DeclarationView source
RevealStateValuets
type RevealStateValue = "hidden" | "shown";