import type { ResolvedPlacement } from "../types"; import GlowTourElement, { type TourElementStep } from "./base"; export interface PopoverPosition { placement: ResolvedPlacement; x: number; y: number; arrowOffset: number | null; } export default class PopoverElement extends GlowTourElement { private appliedPosition; private pendingReposition; private repositionPhase; private repositionGeneration; private readonly mutationLease; protected _getNextStyles(position: DOMRect, step: TourElementStep): Keyframe; resolvePosition(targetPosition: DOMRect, step: TourElementStep): PopoverPosition; /** * Marks the popover as waiting for the next step's target. Written through the mutation lease, * like every other attribute the popover owns, so unbinding the element gives it back clean. */ setAwaitingTarget(awaiting: boolean): void; private _centerPosition; private _applyPositionState; /** * Fades the popover in at `nextPosition` and commits that placement. * * The outgoing half of a step change is `disappear(false)`, which keeps the * popover exposed to assistive technology, deliberately kept separate: between the two, the caller swaps the step's * content while the popover is faded out, and — when the step scrolls — waits * for the scroll to settle so this entrance reads a rect that will not move * again. */ present(nextPosition: DOMRect, step: TourElementStep): Promise; /** * Resets the popover to its idle presentation. A step change that replaces a * visible popover passes `false`: the popover stays exposed so its live * region announces the new step and focus stays in it. */ initializeProps(hideFromAssistiveTechnology?: boolean): void; updatePosition(nextPosition: DOMRect, step: TourElementStep, onReposition?: (reposition: Promise) => void): ResolvedPlacement; cancelAnimations(): void; private _flushReposition; private _applyTransform; private _stationaryPosition; private _applyArrowStyles; private _applyArrowStyle; _appear(position: DOMRect, step: TourElementStep): Promise; _disappear(hideFromAssistiveTechnology?: boolean): Promise; protected _release(): void; private _applyVisibleState; /** * Out of sight but still exposed to assistive technology. Pointer input is blocked the way * `inert` blocks it: the controller ignores commands mid-transition, so a click must not look * accepted. */ private _applyFadedState; private _applyHiddenState; }