/** * AnchorPopConfig - Configuration class for AnchorPop components * * Encapsulates all state and configuration for a popover with smart defaults. * Uses Svelte 5 runes for reactivity. * * @example * ```js * const config = new AnchorPopConfig({ * placement: 'outside', * position_area: 'y-end' * }); * ``` */ export class AnchorPopConfig { /** * Create a config with preset for tooltip-style popover (top) * @param {Partial<{id: string, offset: number}>} [options={}] */ static tooltip_top(options?: Partial<{ id: string; offset: number; }>): AnchorPopConfig; /** * Create a config with preset for tooltip-style popover (bottom) * @param {Partial<{id: string, offset: number}>} [options={}] */ static tooltip_bottom(options?: Partial<{ id: string; offset: number; }>): AnchorPopConfig; /** * Create a config with preset for dropdown menu * @param {Partial<{id: string, offset: number}>} [options={}] */ static dropdown(options?: Partial<{ id: string; offset: number; }>): AnchorPopConfig; /** * Create a config with preset for sidebar * @param {Partial<{id: string, side: 'left' | 'right', offset: number}>} [options={}] */ static sidebar(options?: Partial<{ id: string; side: "left" | "right"; offset: number; }>): AnchorPopConfig; /** * @param {Partial<{ * id: string, * placement: 'outside' | 'inside' | 'overlay' | 'border', * position_area: string, * align_self: string, * justify_self: string, * offset: number, * flip_axis: 'none' | 'x' | 'y' | 'diagonal' | 'all', * position_try_order: 'auto' | 'inline' | 'block' | 'normal', * mode: 'auto' | 'manual', * arrow_color: string, * arrow_stroke_width: number, * arrow_heads: {start?: {show?: boolean, shape?: string, offset?: number}, end?: {show?: boolean, shape?: string, offset?: number}} * }>} [options={}] */ constructor(options?: Partial<{ id: string; placement: "outside" | "inside" | "overlay" | "border"; position_area: string; align_self: string; justify_self: string; offset: number; flip_axis: "none" | "x" | "y" | "diagonal" | "all"; position_try_order: "auto" | "inline" | "block" | "normal"; mode: "auto" | "manual"; arrow_color: string; arrow_stroke_width: number; arrow_heads: { start?: { show?: boolean; shape?: string; offset?: number; }; end?: { show?: boolean; shape?: string; offset?: number; }; }; }>); /** @type {string} Unique ID for this popover */ id: string; /** @type {'outside' | 'inside' | 'overlay' | 'border'} */ placement: "outside" | "inside" | "overlay" | "border"; /** @type {string} */ position_area: string; /** @type {string} */ align_self: string; /** @type {string} */ justify_self: string; /** @type {number} */ offset: number; /** @type {'none' | 'x' | 'y' | 'diagonal' | 'all'} */ flip_axis: "none" | "x" | "y" | "diagonal" | "all"; /** @type {'auto' | 'inline' | 'block' | 'normal'} */ position_try_order: "auto" | "inline" | "block" | "normal"; /** @type {'auto' | 'manual'} */ mode: "auto" | "manual"; /** @type {string} */ arrow_color: string; /** @type {number} */ arrow_stroke_width: number; /** @type {{start?: {show?: boolean, shape?: string, offset?: number}, end?: {show?: boolean, shape?: string, offset?: number}}} */ arrow_heads: { start?: { show?: boolean; shape?: string; offset?: number; }; end?: { show?: boolean; shape?: string; offset?: number; }; }; /** @type {HTMLElement | null} */ popover_ref: HTMLElement | null; /** @type {number} */ popover_width: number; /** @type {number} */ popover_height: number; /** @type {string} Source anchor name (where the connection starts from) */ from_anchor: string; /** @type {string} Target anchor name (where the connection points to) */ to_anchor: string; /** @type {Array<{position_area: string, align_self: string, justify_self: string}>} Computed fallback chain */ fallback_chain: Array<{ position_area: string; align_self: string; justify_self: string; }>; /** @type {boolean} Check if arrow should be shown */ show_arrow: boolean; }