import type { IDisposableLike } from '@breadstone/mosaik-elements'; /** * A lightweight container that preserves Shadow DOM styles for elements * that are temporarily moved outside their original Shadow Root during drag operations. * * @description * When an element inside a Shadow DOM (e.g. a `[part='item']` inside ``) * is moved to `document.body` for `position: fixed` dragging, it loses all scoped styles from its * host's Shadow Root. This container solves that by creating a temporary Shadow Root on `document.body` * and adopting the same `CSSStyleSheet` instances from the source Shadow Root. * * The element is placed **directly** in the new Shadow Tree (not slotted), so attribute selectors * like `[part='item']` continue to match. The Shadow Root also ensures full style isolation — * no styles leak in or out. * * @example * ```typescript * const container = new DragStyleContainer(sourceShadowRoot); * container.attach(dragElement); * // ... drag operation ... * container.dispose(); // removes container, element must be moved back before this * ``` * * @public */ export declare class DragStyleContainer implements IDisposableLike { private _host; private _shadowRoot; /** * Creates a new DragStyleContainer that adopts styles from the given source Shadow Root. * * @param source - The Shadow Root whose `adoptedStyleSheets` should be inherited. * * @public */ constructor(source: ShadowRoot); /** * Gets the Shadow Root of this container. * Use this to append drag elements into the styled scope. * * @public * @readonly */ get root(): ShadowRoot; /** * Appends an element into the styled Shadow Root. * * @param element - The element to place inside the container. * * @public */ attach(element: HTMLElement): void; /** * Removes the container and its Shadow Root from the DOM. * * @remarks * The caller is responsible for moving any child elements back to their * original DOM position **before** calling dispose. * * @public */ dispose(): void; } //# sourceMappingURL=DragStyleContainer.d.ts.map