export interface StackItem { id: string; /** Where the thread wants its top edge (page coordinates). */ want: number; height: number; } export interface Box { left: number; top: number; width: number; height: number; } export interface Viewport { width: number; /** The bottom of what can be seen; `top`, its top (a phone's on-screen keyboard covers the rest). */ height: number; top?: number; /** * Where the comment control's corner starts (its left and top edges, and the left of comment mode's touch hint * beside it): a box reaching past `left` stays above `top`, so nothing sits under the control. */ keep?: { left: number; top: number; }; } export interface AnchorPoint { x: number; y: number; /** Text comments open below their line; element comments open beside. */ below: boolean; /** What it is about: with no room beside, an element or pin's popover goes below it or above, not over it. */ box: Box; } /** Threads sit level with what they're about; overlaps push down; the open thread aligns exactly. */ export declare function stackColumn(items: StackItem[], activeId: string | null, gap?: number): Map; /** * All comments' width, and a popover's (threads, drafts, the side popover). The only place they are set: the * host writes them onto Pipeup's layer as --pu-panel and --pu-pop for the stylesheet. */ export declare const PANEL = 320; export declare const POPOVER = 300; /** A popover's width: roomier where the window has the space (All comments keeps its own width). */ export declare const popover: () => number; /** On screens this narrow or less, All comments takes the whole width (it gets .full). */ export declare const NARROW = 480; export declare const narrow: () => boolean; /** A touch screen: a finger is the main pointer (the stylesheet's `pointer: coarse`). */ export declare const touch: () => boolean; export declare const setPanned: (px: number) => void; /** * What of the window can be seen, top to bottom: a phone's on-screen keyboard covers the bottom of the window without * making it shorter (only the visual viewport shrinks), and the page may be panned within it. */ export declare function seen(): { top: number; bottom: number; }; /** The viewport left for popovers: what can be seen, less All comments' width from the right when it is open. */ export declare function room(listing: boolean): Viewport; export declare function placePopover(at: AnchorPoint, size: { width: number; height: number; }, vp: Viewport, margin?: number): { left: number; top: number; }; /** * An element draft: just below its block, above it when there is no room below, never over the block or the * naming bar (which sits above the block, or below it when there is no room above). A block too tall for either * keeps the box on screen, as low as it fits. Where the comment control's corner is in the way below, the box moves left * of the control if it can, rather than up over the block. */ export declare function placeDraft(block: Box, size: { width: number; height: number; }, vp: Viewport, margin?: number, bar?: number): { left: number; top: number; above: boolean; }; /** * The naming bar (and the selection's icon): centred above the target, or below it when there's no room; never covering * it. A target taller than the window has room for neither: the bar sits at the window's top, over it. */ export declare function placeBar(target: Box, size: { width: number; height: number; }, vp: Viewport): { left: number; top: number; }; /** * The selection's comment icon: just past the right of its block's text, level with the selection's last line, so it * covers no words; above the selection (or below) when there's no room there. On a touch screen (`below`), at the * window's right edge, level with the selection's last line (its first, when the last runs into that edge): the * phone's own menu for a selection sits above or below it, never beside, and its handles sit at its ends. */ export declare function placeIcon(sel: Box, line: Box, textRight: number, size: { width: number; height: number; }, vp: Viewport, below?: boolean): { left: number; top: number; };