/** * Widget layout vocabulary (spec: "Widget Layout Manager") — the shared, * framework-free half of the slot system: slot names, legacy-corner * aliasing, per-slot flex layout parameters, and the `widget-style` token * sugar parser. Both front-ends derive their containers from THIS table * (the HTML lane as cssText, the React lane as CSSProperties) so the two * lanes cannot drift on placement semantics. * * Names are LOGICAL and RTL-aware: `-start`/`-end` map to CSS * `inset-inline-*` and flex alignment, so an RTL document mirrors the * whole chrome without any per-widget work. Legacy corner names stay as * aliases mapped logically (`top-left` → `top-start`), which means legacy * manifests mirror correctly under RTL too — physical-corner fidelity is * deliberately NOT preserved there. */ export declare const MANAGED_SLOTS: readonly ["top-start", "top-center", "top-end", "center-start", "center-end", "bottom-start", "bottom-center", "bottom-end"]; export type ManagedSlot = (typeof MANAGED_SLOTS)[number]; /** A widget's resolved placement: a managed slot, or the author-styled manual tier. */ export type WidgetSlot = ManagedSlot | "manual"; /** Responsive fold drawers follow the four logical sides of the map. */ export type FoldSide = "top" | "end" | "bottom" | "start"; export declare const FOLD_SIDES: readonly FoldSide[]; /** * Slot → responsive drawer. Corner widgets follow their block side (top or * bottom); the two side-center slots follow their logical inline side. This * is the issue-#21 grouping: one disclosure per map side, never one global * drawer. */ export declare function foldSideForSlot(slot: ManagedSlot): FoldSide; /** The managed slot that owns each drawer toggle, keeping it in normal flow. */ export declare function foldToggleSlot(side: FoldSide): ManagedSlot; /** Shared drawer plumbing styles for the HTML and React front-ends. */ export declare function foldDrawerStyle(side?: FoldSide): Record; export declare function foldPanelStyle(side: FoldSide): Record; /** Default fold breakpoint (px) when `--om-widget-fold-breakpoint` is unset. */ export declare const DEFAULT_FOLD_BREAKPOINT_PX = 640; /** * Hysteresis band (px) so a map whose width oscillates around the breakpoint * (drag-resize, flex, split-pane, a CSS transition) doesn't flap fold/unfold * every ResizeObserver tick: fold at width ≤ breakpoint, unfold only once * width ≥ breakpoint + this margin. */ export declare const FOLD_HYSTERESIS_PX = 40; /** * `--om-widget-fold-breakpoint` (already read to `raw`) → px — ONE resolver * for both front-ends so they can't fold at different widths. Accepts px, a * bare number, or author units (rem/em/vw…) resolved through a transient * probe appended to `probeParent` (the browser is the unit converter — no * second implementation). Takes the raw string (not the element) so callers * can cache on it and skip the probe when unchanged. */ export declare function resolveFoldBreakpointPx(raw: string, probeParent: HTMLElement): number; /** Fold decision with hysteresis — pure, shared by both lanes. `currentlyFolded` supplies the band's direction. */ export declare function shouldFoldAtWidth(width: number, breakpointPx: number, currentlyFolded: boolean): boolean; export declare function foldToggleStyle(): Record; /** Legacy 4-corner vocabulary (pre-0.4.1) — accepted forever, mapped LOGICALLY. */ export declare const LEGACY_POSITION_ALIASES: Readonly>; /** Every accepted `position` value (validation + html-data). */ export declare const ALL_POSITION_VALUES: readonly string[]; /** * `position` attribute/prop → slot. Absent/empty → the default `top-start` * (today's `top-left` default, aliased). Unknown values → null; callers * warn and fall back to the default (validation carries the loud version). */ export declare function resolveSlot(raw: string | null | undefined): WidgetSlot | null; export interface SlotLayout { /** Stack axis: edge-center slots run ALONG their edge (row); everything else stacks as a column. */ axis: "column" | "row"; block: "top" | "center" | "bottom"; inline: "start" | "center" | "end"; } export declare function slotLayout(slot: ManagedSlot): SlotLayout; /** * The slot container's styles as a camelCase style object — ONE builder for * both front-ends (the React lane spreads it as CSSProperties; the HTML * lane serializes it to cssText), so the lanes cannot drift on placement. * Insets/gaps read the layout tokens with the pre-0.4.1 constants as * fallbacks (12px inset, 8px gap), so a single-widget legacy corner renders * pixel-identically. Containers never intercept the map's pointer events; * each widget re-enables its own. */ export declare function slotContainerStyle(slot: ManagedSlot): Record; /** The HTML lane's serialization of slotContainerStyle. */ export declare function slotContainerCssText(slot: ManagedSlot): string; export declare const WIDGET_STYLE_KEY_NAMES: readonly string[]; export interface WidgetStyleParse { /** Custom property → CSS value, ready for style.setProperty. */ properties: Record; /** Unparseable entries (unknown key / non-numeric value) — validation's loud half; the live path skips them. */ errors: string[]; } /** * `widget-style="gap:10 opacity:0.9 inset-x:16"` → custom properties — the * no-CSS token surface for agents/authors. Space-separated `key:value` * pairs; numbers get `px` except opacity. One parser serves the live path * (om-map attr → host properties) and validation. */ export declare function parseWidgetStyle(raw: string): WidgetStyleParse;