import type { AcUiDockPanelSide } from '../config/types'; import type { AcUiI18n } from '../i18n'; /** Tab definition for {@link AcUiDockPanel}. */ export interface AcUiDockPanelTab { /** Stable tab identifier. */ id: string; /** i18n key under the `simpleUi` namespace. */ labelKey?: string; /** Plain label when no i18n key is provided. */ label?: string; /** Tab content element. */ content: HTMLElement; } /** Constructor options for {@link AcUiDockPanel}. */ export interface AcUiDockPanelOptions { /** Viewer host element; dock panel is appended as a direct child. */ host: HTMLElement; /** i18n helper for labels. */ i18n: AcUiI18n; /** Initial dock side. @default 'left' */ defaultSide?: AcUiDockPanelSide; /** Whether the panel starts open. @default false */ defaultOpen?: boolean; /** Called when the panel is opened (including tab switches while open). */ onOpen?: () => void; /** Bottom dock default height in px. @default 240 */ defaultHeight?: number; /** Left/right dock default width in px. @default 280 */ defaultWidth?: number; } /** * Chrome DevTools-style dock panel with tabs, open/close, and dock side selection. */ export declare class AcUiDockPanel { private host; private readonly i18n; private readonly root; private readonly contentEl; private readonly tabsWrap; private readonly tabsEl; private readonly overflowButton; private readonly bodyEl; private readonly resizeHandle; private readonly sideMenuButton; private readonly closeButton; private readonly sheetChrome; private readonly sheetGrabber; private readonly sheetCloseButton; private readonly tabs; private activeTabId?; private side; private isPanelOpen; private size; private defaultHeight; private defaultWidth; /** Invoked at the start of {@link open} so callers can dismiss sub-toolbars. */ private readonly onOpen?; private sideMenuRoot?; private overflowMenuRoot?; private overflowTabIds; private tabOverflowFrame?; private tabOverflowObserver?; private resizePointerId?; private resizeStartPos; private resizeStartSize; /** Element that captured the active resize pointer (handle or sheet grabber). */ private resizeCaptureTarget?; /** Wraps canvas content so only the drawing area shrinks when the dock opens. */ private dockMainWrapper?; private mobileMediaQuery?; private handleResizePointerDown; private handleResizePointerMove; private handleResizePointerUp; private handleDocumentPointerDown; /** * @param options - Host, i18n, and initial layout options. */ constructor(options: AcUiDockPanelOptions); /** Whether a tab with the given id is registered. */ hasTab(tabId: string): boolean; /** * Registers a tab with the dock panel. * * @param tab - Tab definition. * @returns `true` when the tab was added; `false` if it already exists or is invalid. */ addTab(tab: AcUiDockPanelTab): boolean; /** * Moves the dock panel to a new mount element (for example when the canvas parent * becomes available after plugin load). * * @param newHost - New mount target. */ reparentTo(newHost: HTMLElement): void; /** Ensures the panel root is attached to the current mount host. */ ensureMounted(): void; /** * Removes a tab and its content panel from the dock. * * @param tabId - Tab identifier to remove. */ removeTab(tabId: string): void; /** Whether the dock panel has any registered tabs. */ get hasTabs(): boolean; /** * Opens the panel and optionally activates a tab. * * @param tabId - Tab to activate. */ open(tabId?: string): void; /** Closes the panel without destroying it. */ close(): void; /** * Toggles panel visibility; when opening, activates the given tab. * * @param tabId - Tab to activate when opening. */ toggle(tabId?: string): void; /** * Switches dock side and re-mounts within the host. * * @param side - New dock side. */ setSide(side: AcUiDockPanelSide): void; /** Current mount host element for the dock panel root. */ getMountHost(): HTMLElement; /** Whether the panel is currently open. */ get isOpen(): boolean; /** Current dock side. */ getSide(): AcUiDockPanelSide; /** Current panel size in px (width for left/right, height for top/bottom). */ getSize(): number; /** * Sets panel size in px, clamped to the dock host bounds. * * @param size - Target size in px. */ setPanelSize(size: number): void; /** Current active tab id, if any. */ get activeTab(): string | undefined; /** Updates tab labels and action button titles after locale change. */ refreshLocale(): void; /** Removes the panel from the DOM and cleans up listeners. */ destroy(): void; private openPanel; private setActiveTab; private ensureHostLayout; /** * Groups existing mount-target children so flex shrink applies to the canvas slot only. */ private ensureDockMainWrapper; /** Moves canvas content out of the dock wrapper and restores the original host tree. */ private releaseDockMainWrapper; private clearHostLayoutClasses; private mountToHost; private applyLayoutState; private setSize; private getMaxSize; /** Whether the dock is shown as a full-width sheet above the phone toolbar. */ private usesPhoneSheet; /** Whether height (rather than width) is resized. */ private usesVerticalResize; private bindMobileMediaQuery; private unbindMobileMediaQuery; private handleMobileMediaChange; private syncPhoneSheetInset; /** Combined height of the in-host toolbar and any visible sub-toolbars. */ private getPhoneChromeInset; private isElementVisible; private toggleSideMenu; private openSideMenu; private renderSideMenuItems; private closeSideMenu; private syncOutsidePointerListener; private scheduleUpdateTabOverflow; private updateTabOverflow; private getTabLabel; private toggleOverflowMenu; private openOverflowMenu; private renderOverflowMenuItems; private closeOverflowMenu; } //# sourceMappingURL=AcUiDockPanel.d.ts.map