@xui/dock-manager 2.0.0-alpha.11 → 2.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"xui-dock-manager.mjs","sources":["../../../../../../libs/ui/dock-manager/xui/src/lib/dock-content.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.types.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.utils.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.ts","../../../../../../libs/ui/dock-manager/xui/src/index.ts","../../../../../../libs/ui/dock-manager/xui/src/xui-dock-manager.ts"],"sourcesContent":["import { Directive, ElementRef, InjectionToken, TemplateRef, effect, inject, input } from '@angular/core';\n\n/**\n * Declares the body of one content pane.\n *\n * The `contentId` links the template to the `contentId` of a\n * {@link XuiDockContentPane} in the layout — the dock manager's equivalent of\n * Ignite UI's `slot=\"…\"` children.\n *\n * ```html\n * <xui-dock-manager [(layout)]=\"layout\">\n * <ng-template xuiDockContent=\"explorer\">…</ng-template>\n * <ng-template xuiDockContent=\"editor\">…</ng-template>\n * </xui-dock-manager>\n * ```\n *\n * The template is instantiated once, the first time its pane is shown, and the\n * resulting view is then kept for as long as the pane is in the layout — docking,\n * floating, unpinning and tab switching all move its DOM rather than rebuilding\n * it, so scroll offsets, half-typed input and component state survive.\n */\n@Directive({ selector: 'ng-template[xuiDockContent]' })\nexport class XuiDockContent {\n /** Matches the `contentId` of a content pane in the layout. */\n readonly contentId = input.required<string>({ alias: 'xuiDockContent' });\n\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n/** What {@link XuiDockContentOutlet} needs from the dock manager above it. */\nexport interface XuiDockContentMounter {\n /** Move the view for `contentId` into `host`, creating it on first use. */\n mountContent(contentId: string, host: HTMLElement): void;\n\n /** Park the view for `contentId` if — and only if — it still sits in `host`. */\n releaseContent(contentId: string, host: HTMLElement): void;\n}\n\nexport const XUI_DOCK_CONTENT_MOUNTER = new InjectionToken<XuiDockContentMounter>('XuiDockContentMounter');\n\n/**\n * Fills its host element with the content view for a `contentId`.\n *\n * Used internally by `xui-dock-manager` wherever a pane body is rendered.\n */\n@Directive({ selector: '[xuiDockContentOutlet]' })\nexport class XuiDockContentOutlet {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n private readonly mounter = inject(XUI_DOCK_CONTENT_MOUNTER);\n\n readonly contentId = input.required<string>({ alias: 'xuiDockContentOutlet' });\n\n constructor() {\n effect(onCleanup => {\n const contentId = this.contentId();\n this.mounter.mountContent(contentId, this.host);\n\n // Angular gives no ordering guarantee between the old outlet's cleanup and\n // the new outlet's mount, so release is conditional on the nodes still\n // being here — otherwise a re-layout could pull content out of the element\n // that just claimed it.\n onCleanup(() => this.mounter.releaseContent(contentId, this.host));\n });\n }\n}\n","/**\n * The dock manager's layout is a plain, serialisable tree — the same shape Ignite\n * UI's `IgcDockManagerLayout` uses, so layouts port across with only the `Igc`\n * prefix dropped. Nothing in the tree holds a DOM reference or an Angular type,\n * which is what makes a layout safe to persist and restore.\n */\n\n/** Discriminator for the four node kinds a layout tree is built from. */\nexport type XuiDockPaneType = 'splitPane' | 'contentPane' | 'tabGroupPane' | 'documentHost';\n\n/** Which axis a split pane lays its children out along. */\nexport type XuiDockSplitOrientation = 'horizontal' | 'vertical';\n\n/**\n * Where a dragged pane lands relative to the pane it was dropped on. `start` and\n * `end` are inline-relative, so they follow the reading direction.\n */\nexport type XuiDockPosition = 'start' | 'end' | 'top' | 'bottom' | 'center';\n\n/** Which edge of the dock manager an unpinned pane's tab sits on. */\nexport type XuiDockUnpinnedLocation = 'start' | 'end' | 'top' | 'bottom';\n\n/** A floating pane's top-left corner, in pixels relative to the dock manager. */\nexport interface XuiDockPoint {\n x: number;\n y: number;\n}\n\ninterface XuiDockPaneBase {\n /**\n * The pane's share of its parent split pane's main axis, as a weight relative\n * to its siblings — two children sized `1` and `3` split the space 25/75.\n * Defaults to `1`.\n */\n size?: number;\n}\n\n/**\n * A leaf pane: a header and a body, where the body is whichever\n * `[xuiDockContent]` template declares the matching `contentId`.\n */\nexport interface XuiDockContentPane extends XuiDockPaneBase {\n type: 'contentPane';\n\n /** Links the pane to its `<ng-template [xuiDockContent]=\"…\">`. Must be unique. */\n contentId: string;\n\n /** Text shown in the pane header, or in its tab when it sits in a tab group. */\n header?: string;\n\n /**\n * `false` collapses the pane to a tab on one of the dock manager's edges; its\n * position in the tree is kept, so re-pinning puts it back where it was.\n * Defaults to `true`.\n */\n isPinned?: boolean;\n\n /** Which edge an unpinned pane's tab sits on. Derived from the tree when unset. */\n unpinnedLocation?: XuiDockUnpinnedLocation;\n\n /** Thickness of the fly-out an unpinned pane opens, in pixels. Defaults to 280. */\n unpinnedSize?: number;\n\n /** `true` fills the whole dock manager, hiding every other pane. */\n isMaximized?: boolean;\n\n /**\n * Restricts the pane to the document host — it cannot be docked outside one,\n * floated or unpinned. Use it for editor-style tabs.\n */\n documentOnly?: boolean;\n\n /** Show the close button and allow programmatic closing. Defaults to `true`. */\n allowClose?: boolean;\n /** Allow the pane to be dragged out of the layout into a floating window. Defaults to `true`. */\n allowFloating?: boolean;\n /** Allow the pane to be dragged and docked elsewhere in the layout. Defaults to `true`. */\n allowDocking?: boolean;\n /** Show the pin button. Defaults to `true`. */\n allowPinning?: boolean;\n /** Show the maximize button. Defaults to `true`. */\n allowMaximize?: boolean;\n}\n\n/**\n * Lays its children out along one axis with a draggable splitter between each\n * pair. Doubles as the root of a floating window, which is where the `floating*`\n * properties apply.\n */\nexport interface XuiDockSplitPane extends XuiDockPaneBase {\n type: 'splitPane';\n orientation: XuiDockSplitOrientation;\n panes: XuiDockPane[];\n\n /**\n * Keep the split pane in the tree once its last child is gone. Needed on a\n * document host's root pane, which must survive closing every document.\n */\n allowEmpty?: boolean;\n\n /** Top-left corner of the floating window, when this is a floating root. */\n floatingLocation?: XuiDockPoint;\n /** Floating window width in pixels. Defaults to 400. */\n floatingWidth?: number;\n /** Floating window height in pixels. Defaults to 300. */\n floatingHeight?: number;\n /** Show resize handles on the floating window. Defaults to `true`. */\n floatingResizable?: boolean;\n}\n\n/** Stacks content panes as tabs, showing one at a time. */\nexport interface XuiDockTabGroupPane extends XuiDockPaneBase {\n type: 'tabGroupPane';\n panes: XuiDockContentPane[];\n\n /** Index of the visible tab. Defaults to 0, and is clamped to the tab count. */\n selectedIndex?: number;\n\n /** Keep the tab group in the tree once its last tab is gone. */\n allowEmpty?: boolean;\n}\n\n/**\n * The area `documentOnly` panes live in — the editor surface of an IDE layout.\n * A layout has at most one, and it is the only valid drop target for documents.\n */\nexport interface XuiDockDocumentHost extends XuiDockPaneBase {\n type: 'documentHost';\n rootPane: XuiDockSplitPane;\n}\n\n/** Any node in the layout tree. */\nexport type XuiDockPane = XuiDockContentPane | XuiDockSplitPane | XuiDockTabGroupPane | XuiDockDocumentHost;\n\n/** A pane that holds children, and so can be a docking target for `center`. */\nexport type XuiDockParentPane = XuiDockSplitPane | XuiDockTabGroupPane;\n\n/** The whole layout: one docked tree plus any number of floating windows. */\nexport interface XuiDockManagerLayout {\n rootPane: XuiDockSplitPane | XuiDockDocumentHost;\n\n /** Each entry is the root of one floating window. */\n floatingPanes?: XuiDockSplitPane[];\n}\n\n/** Emitted whenever a pane's pinned, maximized or floating state is toggled. */\nexport interface XuiDockPaneStateEvent {\n pane: XuiDockContentPane;\n value: boolean;\n}\n\nexport function isContentPane(pane: XuiDockPane): pane is XuiDockContentPane {\n return pane.type === 'contentPane';\n}\n\nexport function isSplitPane(pane: XuiDockPane): pane is XuiDockSplitPane {\n return pane.type === 'splitPane';\n}\n\nexport function isTabGroupPane(pane: XuiDockPane): pane is XuiDockTabGroupPane {\n return pane.type === 'tabGroupPane';\n}\n\nexport function isDocumentHost(pane: XuiDockPane): pane is XuiDockDocumentHost {\n return pane.type === 'documentHost';\n}\n\nexport function isParentPane(pane: XuiDockPane): pane is XuiDockParentPane {\n return pane.type === 'splitPane' || pane.type === 'tabGroupPane';\n}\n","import {\n isContentPane,\n isDocumentHost,\n isParentPane,\n isSplitPane,\n isTabGroupPane,\n type XuiDockContentPane,\n type XuiDockDocumentHost,\n type XuiDockManagerLayout,\n type XuiDockPane,\n type XuiDockParentPane,\n type XuiDockPoint,\n type XuiDockPosition,\n type XuiDockSplitOrientation,\n type XuiDockSplitPane,\n type XuiDockTabGroupPane,\n type XuiDockUnpinnedLocation\n} from './dock-manager.types';\n\n/**\n * Tree operations over a {@link XuiDockManagerLayout}.\n *\n * Every mutating function works **in place** on the layout object it is given and\n * leaves the pane objects themselves identity-stable: docking a pane re-parents\n * the very same object rather than a copy. The dock manager depends on that — it\n * keys rendered panes, cached content views and drag targets off object identity,\n * so a pane keeps its DOM (and therefore its scroll position, form state and\n * focus) as it moves around the layout.\n *\n * Callers that need an undo buffer should snapshot with {@link cloneDockLayout}\n * before mutating.\n */\n\nconst paneKeys = new WeakMap<XuiDockPane, string>();\nlet nextPaneKey = 0;\n\n/**\n * A stable string key for a pane object, allocated on first use.\n *\n * Used for `@for` tracking and for finding the pane behind a DOM element during a\n * drag. Keyed by object identity, so it survives every operation in this file and\n * is *not* preserved by {@link cloneDockLayout}.\n */\nexport function dockPaneKey(pane: XuiDockPane): string {\n let key = paneKeys.get(pane);\n\n if (!key) {\n key = `pane-${++nextPaneKey}`;\n paneKeys.set(pane, key);\n }\n\n return key;\n}\n\n/**\n * A structural copy of the layout, safe to keep as an undo snapshot.\n *\n * A round-trip through JSON, which the layout's own contract allows: every node\n * is plain data. The copy is a *different* set of objects, so its panes get fresh\n * {@link dockPaneKey}s and restoring it replaces the rendered panes rather than\n * moving them.\n */\nexport function cloneDockLayout(layout: XuiDockManagerLayout): XuiDockManagerLayout {\n return JSON.parse(JSON.stringify(layout)) as XuiDockManagerLayout;\n}\n\n/** The child panes of `pane`, or an empty array for a leaf. */\nexport function dockChildren(pane: XuiDockPane): readonly XuiDockPane[] {\n if (isParentPane(pane)) {\n return pane.panes;\n }\n\n return isDocumentHost(pane) ? [pane.rootPane] : [];\n}\n\n/** Every root of the layout: the docked tree, then each floating window. */\nexport function dockRoots(layout: XuiDockManagerLayout): XuiDockPane[] {\n return [layout.rootPane, ...(layout.floatingPanes ?? [])];\n}\n\n/**\n * Depth-first walk over every pane in the layout, floating windows included.\n * Returning `false` from `visitor` skips that pane's subtree.\n */\nexport function visitDockPanes(layout: XuiDockManagerLayout, visitor: (pane: XuiDockPane) => boolean | void): void {\n const walk = (pane: XuiDockPane): void => {\n if (visitor(pane) === false) {\n return;\n }\n\n for (const child of [...dockChildren(pane)]) {\n walk(child);\n }\n };\n\n for (const root of dockRoots(layout)) {\n walk(root);\n }\n}\n\n/** The pane whose `panes` array holds `pane`, or `null` for a root. */\nexport function findDockParent(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockParentPane | null {\n let found: XuiDockParentPane | null = null;\n\n visitDockPanes(layout, candidate => {\n if (found) {\n return false;\n }\n\n if (isParentPane(candidate) && candidate.panes.includes(pane as XuiDockContentPane)) {\n found = candidate;\n return false;\n }\n\n return undefined;\n });\n\n return found;\n}\n\n/** `pane`'s ancestors, nearest first. */\nexport function dockAncestors(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockPane[] {\n const path: XuiDockPane[] = [];\n\n const walk = (current: XuiDockPane, trail: XuiDockPane[]): boolean => {\n if (current === pane) {\n path.push(...trail);\n return true;\n }\n\n for (const child of dockChildren(current)) {\n if (walk(child, [current, ...trail])) {\n return true;\n }\n }\n\n return false;\n };\n\n for (const root of dockRoots(layout)) {\n if (walk(root, [])) {\n break;\n }\n }\n\n return path;\n}\n\n/** The layout's document host, if it has one. */\nexport function findDocumentHost(layout: XuiDockManagerLayout): XuiDockDocumentHost | null {\n let host: XuiDockDocumentHost | null = null;\n\n visitDockPanes(layout, pane => {\n if (host) {\n return false;\n }\n\n if (isDocumentHost(pane)) {\n host = pane;\n return false;\n }\n\n return undefined;\n });\n\n return host;\n}\n\n/** Whether `pane` sits inside the document host. */\nexport function isInDocumentHost(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return dockAncestors(layout, pane).some(isDocumentHost);\n}\n\n/** Whether `pane` is the root of a floating window. */\nexport function isFloatingRoot(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return (layout.floatingPanes ?? []).includes(pane as XuiDockSplitPane);\n}\n\n/** Whether `pane` is a root that must not be collapsed away. */\nexport function isDockRoot(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return pane === layout.rootPane || isFloatingRoot(layout, pane);\n}\n\n/** Every content pane in the layout, in tree order. */\nexport function collectContentPanes(layout: XuiDockManagerLayout): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n\n visitDockPanes(layout, pane => {\n if (isContentPane(pane)) {\n out.push(pane);\n }\n });\n\n return out;\n}\n\n/** The content pane that is currently maximized, if any. */\nexport function findMaximizedPane(layout: XuiDockManagerLayout): XuiDockContentPane | null {\n return collectContentPanes(layout).find(pane => pane.isMaximized) ?? null;\n}\n\n/**\n * Whether the pane takes up space in the docked layout. An unpinned content pane\n * does not, and neither does a split pane or tab group whose whole subtree is\n * unpinned — otherwise collapsing a sidebar would leave a gap behind it.\n */\nexport function isDockPaneVisible(pane: XuiDockPane): boolean {\n if (isContentPane(pane)) {\n return pane.isPinned !== false;\n }\n\n if (isDocumentHost(pane)) {\n return true;\n }\n\n return pane.panes.some(isDockPaneVisible);\n}\n\n/** The children of `pane` that take up space, in order. */\nexport function visibleDockChildren(pane: XuiDockPane): XuiDockPane[] {\n return [...dockChildren(pane)].filter(isDockPaneVisible);\n}\n\n/** The tab a tab group shows: its `selectedIndex`, or the first pinned tab. */\nexport function selectedTabPane(group: XuiDockTabGroupPane): XuiDockContentPane | null {\n const visible = group.panes.filter(isDockPaneVisible);\n\n if (!visible.length) {\n return null;\n }\n\n const selected = group.panes[group.selectedIndex ?? 0];\n\n return selected && visible.includes(selected) ? selected : visible[0];\n}\n\n/**\n * Which edge an unpinned pane collapses to when `unpinnedLocation` is unset.\n *\n * Follows the pane's own position in the tree — a pane in the first branch of a\n * horizontal split goes to the inline start, one in the last branch to the inline\n * end — so a sidebar collapses to the side it was already on.\n */\nexport function defaultUnpinnedLocation(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockUnpinnedLocation {\n let child = pane;\n\n for (const ancestor of dockAncestors(layout, pane)) {\n if (isSplitPane(ancestor) && ancestor.panes.length > 1) {\n const first = ancestor.panes.indexOf(child as XuiDockContentPane) === 0;\n\n if (ancestor.orientation === 'horizontal') {\n return first ? 'start' : 'end';\n }\n\n return first ? 'top' : 'bottom';\n }\n\n child = ancestor;\n }\n\n return 'end';\n}\n\n/** The unpinned content panes, grouped by the edge their tabs sit on. */\nexport function unpinnedDockPanes(layout: XuiDockManagerLayout): Record<XuiDockUnpinnedLocation, XuiDockContentPane[]> {\n const groups: Record<XuiDockUnpinnedLocation, XuiDockContentPane[]> = { start: [], end: [], top: [], bottom: [] };\n\n for (const pane of collectContentPanes(layout)) {\n if (pane.isPinned === false) {\n groups[pane.unpinnedLocation ?? defaultUnpinnedLocation(layout, pane)].push(pane);\n }\n }\n\n return groups;\n}\n\n/**\n * Tidy the tree after a mutation: drop empty parents, unwrap split panes down to\n * a single child, merge nested splits that run along the same axis, and clamp\n * every tab group's selected index.\n *\n * Roots survive all of this — `layout.rootPane`, a floating window's root and a\n * document host's root pane are structural and stay put even when empty. A root\n * left with a single split pane beneath it absorbs that child rather than being\n * replaced by it.\n */\nexport function normalizeDockLayout(layout: XuiDockManagerLayout): void {\n const root = normalizePane(layout.rootPane, true);\n layout.rootPane = (root ?? emptySplitPane()) as XuiDockSplitPane | XuiDockDocumentHost;\n\n const floating: XuiDockSplitPane[] = [];\n\n for (const pane of layout.floatingPanes ?? []) {\n const normalized = normalizePane(pane, true);\n\n // A floating window whose last pane was closed or docked away is gone.\n if (normalized && isSplitPane(normalized) && normalized.panes.length) {\n floating.push(normalized);\n }\n }\n\n layout.floatingPanes = floating;\n}\n\nfunction emptySplitPane(): XuiDockSplitPane {\n return { type: 'splitPane', orientation: 'horizontal', panes: [], allowEmpty: true };\n}\n\nfunction normalizePane(pane: XuiDockPane, isRoot: boolean): XuiDockPane | null {\n if (isContentPane(pane)) {\n return pane;\n }\n\n if (isDocumentHost(pane)) {\n const inner = normalizePane(pane.rootPane, true);\n pane.rootPane = inner && isSplitPane(inner) ? inner : emptySplitPane();\n // The document host is structural: an empty editor area is a valid state.\n return pane;\n }\n\n if (isTabGroupPane(pane)) {\n if (!pane.panes.length && !pane.allowEmpty && !isRoot) {\n return null;\n }\n\n pane.selectedIndex = Math.min(Math.max(pane.selectedIndex ?? 0, 0), Math.max(0, pane.panes.length - 1));\n return pane;\n }\n\n const children: XuiDockPane[] = [];\n\n for (const child of pane.panes) {\n const normalized = normalizePane(child, false);\n\n if (!normalized) {\n continue;\n }\n\n // A split inside a split along the same axis is the same layout with an extra\n // level of nesting; splice it away so repeated docking cannot grow the tree\n // without bound.\n if (isSplitPane(normalized) && normalized.orientation === pane.orientation && normalized.panes.length > 1) {\n children.push(...redistribute(normalized.panes, normalized.size ?? 1));\n continue;\n }\n\n children.push(normalized);\n }\n\n pane.panes = children;\n\n if (!children.length) {\n return pane.allowEmpty || isRoot ? pane : null;\n }\n\n if (children.length === 1) {\n const only = children[0];\n\n if (!isRoot) {\n // The wrapper's share of the grandparent becomes the child's.\n only.size = pane.size ?? only.size;\n return only;\n }\n\n // A root cannot be replaced — floating geometry and the caller's reference\n // hang off it — so it absorbs its lone child's axis and children instead.\n // Without this, every drop onto the root would leave another dead level.\n if (isSplitPane(only)) {\n pane.orientation = only.orientation;\n pane.panes = only.panes;\n }\n }\n\n return pane;\n}\n\n/** Rescale `panes` so their weights sum to `total`, keeping their proportions. */\nfunction redistribute(panes: XuiDockPane[], total: number): XuiDockPane[] {\n const sum = panes.reduce((acc, pane) => acc + (pane.size ?? 1), 0) || panes.length;\n\n for (const pane of panes) {\n pane.size = ((pane.size ?? 1) / sum) * total;\n }\n\n return panes;\n}\n\n/**\n * Detach `pane` from wherever it sits — a parent's `panes`, or the floating\n * window list — and tidy up behind it. Returns `false` if it was not in the\n * layout at all.\n */\nexport function removeDockPane(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n const floating = layout.floatingPanes ?? [];\n const floatingIndex = floating.indexOf(pane as XuiDockSplitPane);\n\n if (floatingIndex >= 0) {\n floating.splice(floatingIndex, 1);\n normalizeDockLayout(layout);\n return true;\n }\n\n const parent = findDockParent(layout, pane);\n\n if (!parent) {\n return false;\n }\n\n parent.panes.splice(parent.panes.indexOf(pane as XuiDockContentPane), 1);\n normalizeDockLayout(layout);\n return true;\n}\n\n/** The axis a docking position splits along. */\nfunction axisOf(position: Exclude<XuiDockPosition, 'center'>): XuiDockSplitOrientation {\n return position === 'start' || position === 'end' ? 'horizontal' : 'vertical';\n}\n\n/** Whether the dragged pane goes before the target along that axis. */\nfunction isBefore(position: Exclude<XuiDockPosition, 'center'>): boolean {\n return position === 'start' || position === 'top';\n}\n\n/**\n * Whether `pane` may be dropped onto `target`.\n *\n * A `documentOnly` pane is confined to the document host; anything else may dock\n * anywhere. A pane can never be dropped onto itself or into its own subtree.\n */\nexport function canDockInto(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (pane === target) {\n return false;\n }\n\n if (dockAncestors(layout, target).includes(pane)) {\n return false;\n }\n\n if (isContentPane(pane) && pane.allowDocking === false) {\n return false;\n }\n\n if (!documentOnlyPanes(pane)) {\n return true;\n }\n\n // Docking against the document host's outer edges would put the document\n // *beside* the editor area rather than in it, so only `center` qualifies.\n return isDocumentHost(target) ? position === 'center' : isInDocumentHost(layout, target);\n}\n\n/** Whether every content pane in `pane`'s subtree is `documentOnly`. */\nfunction documentOnlyPanes(pane: XuiDockPane): boolean {\n const contents: XuiDockContentPane[] = [];\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n contents.push(current);\n return;\n }\n\n for (const child of dockChildren(current)) {\n walk(child);\n }\n };\n\n walk(pane);\n\n return contents.length > 0 && contents.every(content => content.documentOnly);\n}\n\n/**\n * Attach `pane` to the layout next to `target`.\n *\n * `center` tabs the pane together with the target — turning a lone content pane\n * into a two-tab group — while the four edge positions split the space. An edge\n * drop reuses the target's parent when it already runs along the right axis, so\n * dropping three panes to the right of each other yields one three-way split\n * rather than three nested ones.\n */\nexport function insertDockPane(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (position === 'center') {\n return insertIntoCenter(layout, pane, target);\n }\n\n const axis = axisOf(position);\n const before = isBefore(position);\n const parent = findDockParent(layout, target);\n\n if (parent && isSplitPane(parent) && parent.orientation === axis) {\n const index = parent.panes.indexOf(target as XuiDockContentPane);\n // Split the target's own share rather than adding weight, so the panes either\n // side of it keep the proportions they had.\n const share = target.size ?? 1;\n target.size = share / 2;\n pane.size = share / 2;\n parent.panes.splice(before ? index : index + 1, 0, pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n // A root has no parent to insert into, so it grows a level instead: it keeps\n // its own identity (and any floating geometry) and adopts the new axis.\n if (!parent && isSplitPane(target) && isDockRoot(layout, target)) {\n if (target.orientation !== axis && target.panes.length > 1) {\n const inner: XuiDockSplitPane = { type: 'splitPane', orientation: target.orientation, panes: target.panes };\n target.panes = [inner];\n }\n\n target.orientation = axis;\n target.panes.splice(before ? 0 : target.panes.length, 0, pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n const wrapper: XuiDockSplitPane = {\n type: 'splitPane',\n orientation: axis,\n size: target.size ?? 1,\n panes: before ? [pane, target] : [target, pane]\n };\n\n target.size = 1;\n pane.size = 1;\n\n return replacePane(layout, target, wrapper);\n}\n\nfunction insertIntoCenter(layout: XuiDockManagerLayout, pane: XuiDockPane, target: XuiDockPane): boolean {\n const incoming = isContentPane(pane) ? [pane] : tabbableContentPanes(pane);\n\n if (isDocumentHost(target)) {\n return insertIntoCenter(layout, pane, target.rootPane);\n }\n\n if (isTabGroupPane(target) && incoming.length) {\n target.panes.push(...incoming);\n target.selectedIndex = target.panes.length - 1;\n normalizeDockLayout(layout);\n return true;\n }\n\n if (isSplitPane(target)) {\n // Nothing to tab with — an empty split pane (a bare document host) simply\n // adopts the pane.\n target.panes.push(pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n if (!isContentPane(target) || !incoming.length) {\n return false;\n }\n\n const group: XuiDockTabGroupPane = {\n type: 'tabGroupPane',\n size: target.size ?? 1,\n panes: [target, ...incoming],\n // Select the pane that was just dropped, the way a dragged browser tab lands\n // in front.\n selectedIndex: 1\n };\n\n target.size = 1;\n\n return replacePane(layout, target, group);\n}\n\n/** The content panes of a subtree, flattened, for merging into a tab group. */\nfunction tabbableContentPanes(pane: XuiDockPane): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n out.push(current);\n return;\n }\n\n for (const child of dockChildren(current)) {\n walk(child);\n }\n };\n\n walk(pane);\n\n return out;\n}\n\n/** Swap `target` for `replacement` wherever it sits, root positions included. */\nfunction replacePane(layout: XuiDockManagerLayout, target: XuiDockPane, replacement: XuiDockPane): boolean {\n if (target === layout.rootPane) {\n layout.rootPane = replacement as XuiDockSplitPane | XuiDockDocumentHost;\n normalizeDockLayout(layout);\n return true;\n }\n\n const floating = layout.floatingPanes ?? [];\n const floatingIndex = floating.indexOf(target as XuiDockSplitPane);\n\n if (floatingIndex >= 0) {\n floating[floatingIndex] = replacement as XuiDockSplitPane;\n normalizeDockLayout(layout);\n return true;\n }\n\n const parent = findDockParent(layout, target);\n\n if (parent) {\n parent.panes[parent.panes.indexOf(target as XuiDockContentPane)] = replacement as XuiDockContentPane;\n normalizeDockLayout(layout);\n return true;\n }\n\n const host = dockAncestors(layout, target).find(isDocumentHost);\n\n if (host && isSplitPane(replacement)) {\n host.rootPane = replacement;\n normalizeDockLayout(layout);\n return true;\n }\n\n return false;\n}\n\n/** Move `pane` out of the layout and into a floating window of its own. */\nexport function floatDockPane(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n location: XuiDockPoint,\n size?: { width: number; height: number }\n): XuiDockSplitPane | null {\n if (isContentPane(pane) && pane.allowFloating === false) {\n return null;\n }\n\n // Already floating: this is a move, not a detach.\n if (isSplitPane(pane) && isFloatingRoot(layout, pane)) {\n pane.floatingLocation = location;\n return pane;\n }\n\n if (!removeDockPane(layout, pane)) {\n return null;\n }\n\n pane.size = 1;\n\n const window: XuiDockSplitPane = {\n type: 'splitPane',\n orientation: 'horizontal',\n panes: [pane],\n floatingLocation: location,\n floatingWidth: size?.width ?? 400,\n floatingHeight: size?.height ?? 300,\n floatingResizable: true\n };\n\n layout.floatingPanes = [...(layout.floatingPanes ?? []), window];\n normalizeDockLayout(layout);\n\n return window;\n}\n\n/** Move `pane` from wherever it is to `position` relative to `target`. */\nexport function dockPaneAt(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (!canDockInto(layout, pane, target, position)) {\n return false;\n }\n\n removeDockPane(layout, pane);\n\n // Geometry only means something while the pane is a floating window; leaving it\n // behind would resurrect the old size the next time it is floated.\n if (isSplitPane(pane)) {\n delete pane.floatingLocation;\n delete pane.floatingWidth;\n delete pane.floatingHeight;\n delete pane.floatingResizable;\n }\n\n // `removeDockPane` normalises, which can unwrap the target's parent — but never\n // the target itself, so it is still a valid insertion point.\n return insertDockPane(layout, pane, target, position);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type EmbeddedViewRef\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n matCloseFullscreenRound,\n matCloseRound,\n matDockRound,\n matOpenInFullRound,\n matOpenInNewRound,\n matPushPinRound\n} from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { arrowDirectionOnAxis, injectXDirection } from '@xui/core/a11y';\nimport { XuiIcon } from '@xui/icon';\nimport type { ClassValue } from 'clsx';\nimport {\n XUI_DOCK_CONTENT_MOUNTER,\n XuiDockContent,\n XuiDockContentOutlet,\n type XuiDockContentMounter\n} from './dock-content';\nimport {\n isContentPane,\n isDocumentHost,\n isSplitPane,\n isTabGroupPane,\n type XuiDockContentPane,\n type XuiDockManagerLayout,\n type XuiDockPane,\n type XuiDockPaneStateEvent,\n type XuiDockPoint,\n type XuiDockPosition,\n type XuiDockSplitPane,\n type XuiDockTabGroupPane,\n type XuiDockUnpinnedLocation\n} from './dock-manager.types';\nimport {\n canDockInto,\n collectContentPanes,\n defaultUnpinnedLocation,\n dockPaneAt,\n dockPaneKey,\n findMaximizedPane,\n floatDockPane,\n normalizeDockLayout,\n removeDockPane,\n selectedTabPane,\n unpinnedDockPanes,\n visibleDockChildren\n} from './dock-manager.utils';\n\n/** Thickness of the edge strips that hold unpinned panes' tabs, in pixels. */\nconst STRIP_SIZE = 32;\n\n/** How close to the dock manager's own edge a drop docks against the whole layout. */\nconst OUTER_EDGE = 28;\n\n/** A pane never resizes below this, so its header always stays grabbable. */\nconst MIN_PANE_SIZE = 48;\n\n/** Where a floating window sits when its layout gives no `floatingLocation`. */\nconst FLOATING_ORIGIN: XuiDockPoint = { x: 40, y: 40 };\n\n/** Pointer travel before a press on a header turns into a drag. */\nconst DRAG_THRESHOLD = 4;\n\n/** The centre of a pane is a \"tab it here\" target; outside it, the nearest edge wins. */\nconst CENTRE_ZONE = 0.3;\n\n/** Size of one docking indicator square, and the gap between them. */\nconst INDICATOR_SIZE = 30;\nconst INDICATOR_GAP = 4;\n\n/** How far the outer ring of indicators sits from the dock manager's frame. */\nconst INDICATOR_INSET = 8;\n\n/** Below this the joystick would not fit inside the pane, so it is not offered. */\nconst INDICATOR_MIN_PANE = 96;\n\ninterface DropTarget {\n pane: XuiDockPane;\n position: XuiDockPosition;\n}\n\n/**\n * One square of the docking joystick, positioned in coordinates relative to the\n * dock manager. `side` is the *visual* half it fills in, which is the mirror of\n * `position` on the inline axis in RTL.\n */\ninterface DockIndicator extends DropTarget {\n key: string;\n side: 'left' | 'right' | 'top' | 'bottom' | 'center';\n left: number;\n top: number;\n active: boolean;\n}\n\ninterface DragState {\n /** The pane being dragged — a content pane, or a floating window's root. */\n pane: XuiDockPane;\n /** Set when the gesture started on a floating window's title bar. */\n window: XuiDockSplitPane | null;\n x: number;\n y: number;\n}\n\ninterface Rect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/**\n * An IDE-style docking layout: resizable split panes, tab groups, a document\n * host, collapsible edge panels and floating windows, all driven by one\n * serialisable {@link XuiDockManagerLayout} tree.\n *\n * ```html\n * <xui-dock-manager [(layout)]=\"layout\" class=\"h-[32rem]\">\n * <ng-template xuiDockContent=\"explorer\">…</ng-template>\n * <ng-template xuiDockContent=\"editor\">…</ng-template>\n * </xui-dock-manager>\n * ```\n *\n * The layout shape follows Ignite UI's `IgcDockManagerLayout`, so existing\n * layouts port over by dropping the `Igc` prefix and using string literals in\n * place of its enums.\n *\n * Panes carry no content of their own: each one names a `contentId`, and the\n * matching `[xuiDockContent]` template supplies the body. Those bodies are\n * instantiated once and then *moved* as the layout changes, so a pane keeps its\n * scroll position and component state when it is dragged to another dock, tabbed,\n * floated or collapsed.\n *\n * `layout` is two-way bindable and the dock manager edits the tree **in place**\n * before emitting, which is what keeps pane identity stable across a drag. Bind a\n * signal to it and snapshot with `cloneDockLayout()` if you need an undo buffer.\n *\n * Dragging is a pointer gesture. Picking up a pane raises Visual Studio's docking\n * targets: a five-way joystick over whichever pane is under the pointer — four\n * arms to split it, the centre to tab with it — and an outer ring at the dock\n * manager's edges to dock against the whole layout. Only the targets the dragged\n * pane is allowed to take are drawn, and the one that would be used is\n * highlighted while an outline previews the space it would claim.\n *\n * Off the targets, the two gestures differ. A header or tab drag has no other\n * purpose, so the whole pane stays live and the nearest edge wins; dropping\n * outside the layout floats the pane. Dragging a floating window's title bar is\n * mostly about *moving* the window, so it docks from the targets alone.\n *\n * Every other operation — close, pin, maximize, float, tab selection, splitter\n * resize — is reachable from the keyboard, and the public methods (`closePane`,\n * `unpinPane`, `dockPane`, …) drive the same paths for code. Docking itself has no\n * keyboard equivalent yet.\n */\n@Component({\n selector: 'xui-dock-manager',\n imports: [NgTemplateOutlet, NgIcon, XuiIcon, XuiDockContentOutlet],\n viewProviders: [\n provideIcons({\n matCloseRound,\n matDockRound,\n matPushPinRound,\n matOpenInFullRound,\n matCloseFullscreenRound,\n matOpenInNewRound\n })\n ],\n providers: [{ provide: XUI_DOCK_CONTENT_MOUNTER, useExisting: forwardRef(() => XuiDockManager) }],\n template: `\n <!-- ─── one content pane: header chrome plus the body outlet ─────────── -->\n <ng-template #contentTpl let-pane let-hideHeader=\"hideHeader\">\n <div\n [class]=\"frameClass(pane)\"\n [attr.data-dock-key]=\"key(pane)\"\n (pointerdown)=\"activate(pane)\"\n (focusin)=\"activate(pane)\"\n >\n @if (!hideHeader) {\n <div\n [class]=\"headerClass(pane)\"\n (pointerdown)=\"startPaneDrag(pane, null, $event)\"\n (dblclick)=\"toggleMaximized(pane)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ pane.header }}</span>\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n }\n\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\" [xuiDockContentOutlet]=\"pane.contentId\"></div>\n </div>\n </ng-template>\n\n <!-- ─── the pin / maximize / close cluster, shared by headers and tabs ── -->\n <ng-template #paneActionsTpl let-pane>\n <div class=\"flex shrink-0 items-center\">\n @if (pane.allowPinning !== false && !pane.documentOnly) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"(pane.isPinned === false ? 'Pin ' : 'Collapse ') + (pane.header || pane.contentId)\"\n (click)=\"togglePinned(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matPushPinRound\" [class]=\"pane.isPinned === false ? 'text-primary' : ''\" />\n </button>\n }\n @if (pane.allowFloating !== false && !pane.documentOnly && !isFloating(pane)) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"'Float ' + (pane.header || pane.contentId)\"\n (click)=\"floatPane(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matOpenInNewRound\" />\n </button>\n }\n @if (pane.allowMaximize !== false) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"(pane.isMaximized ? 'Restore ' : 'Maximize ') + (pane.header || pane.contentId)\"\n (click)=\"toggleMaximized(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" [name]=\"pane.isMaximized ? 'matCloseFullscreenRound' : 'matOpenInFullRound'\" />\n </button>\n }\n @if (pane.allowClose !== false) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"'Close ' + (pane.header || pane.contentId)\"\n (click)=\"closePane(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matCloseRound\" />\n </button>\n }\n </div>\n </ng-template>\n\n <!-- ─── a tab group: one strip, one visible body ─────────────────────── -->\n <ng-template #tabGroupTpl let-pane>\n <div [class]=\"frameClass(pane)\" [attr.data-dock-key]=\"key(pane)\">\n <div [class]=\"tabStripClass()\" role=\"tablist\">\n @for (tab of pinnedTabs(pane); track key(tab)) {\n <button\n type=\"button\"\n role=\"tab\"\n [class]=\"tabClass(pane, tab)\"\n [attr.aria-selected]=\"tab === selectedTab(pane)\"\n [tabindex]=\"tab === selectedTab(pane) ? 0 : -1\"\n (click)=\"selectPane(tab)\"\n (pointerdown)=\"startPaneDrag(tab, null, $event)\"\n (dblclick)=\"toggleMaximized(tab)\"\n (keydown)=\"onTabKeydown(pane, $event)\"\n >\n <span class=\"min-w-0 truncate\">{{ tab.header }}</span>\n @if (tab.allowClose !== false) {\n <!-- A nested <button> is invalid markup, so this affordance is\n pointer-only and hidden from assistive technology; the\n action cluster on the right carries the real close button. -->\n <span\n aria-hidden=\"true\"\n [class]=\"tabCloseClass()\"\n (click)=\"closePane(tab); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"12px\" name=\"matCloseRound\" />\n </span>\n }\n </button>\n }\n\n @if (selectedTab(pane); as tab) {\n <div class=\"ms-auto flex items-center ps-1\">\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: tab }\" />\n </div>\n }\n </div>\n\n @if (selectedTab(pane); as tab) {\n <div\n role=\"tabpanel\"\n class=\"min-h-0 min-w-0 flex-1 overflow-auto\"\n [xuiDockContentOutlet]=\"tab.contentId\"\n (pointerdown)=\"activate(tab)\"\n (focusin)=\"activate(tab)\"\n ></div>\n }\n </div>\n </ng-template>\n\n <!-- ─── a split pane: children along one axis, gutters in between ────── -->\n <ng-template #splitTpl let-pane>\n <div [class]=\"splitClass(pane)\">\n @for (child of childrenOf(pane); track key(child); let i = $index, last = $last) {\n <div class=\"relative flex min-h-0 min-w-0\" [style.flex]=\"flexOf(child)\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: child }\" />\n </div>\n\n @if (!last) {\n <!-- Drag or arrow-key the gutter to trade space between the panes\n either side of it. -->\n <div\n role=\"separator\"\n tabindex=\"0\"\n [class]=\"gutterClass(pane)\"\n [attr.aria-orientation]=\"pane.orientation === 'vertical' ? 'horizontal' : 'vertical'\"\n [attr.aria-label]=\"'Resize ' + headerOf(child)\"\n (pointerdown)=\"startSplitterDrag(pane, i, $event)\"\n (keydown)=\"onSplitterKeydown(pane, i, $event)\"\n >\n <span [class]=\"gutterHandleClass(pane)\"></span>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- ─── the document host: the only home for documentOnly panes ─────── -->\n <ng-template #documentHostTpl let-pane>\n <div class=\"bg-surface-sunken flex min-h-0 min-w-0 flex-1\" [attr.data-dock-key]=\"key(pane)\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane.rootPane }\" />\n </div>\n </ng-template>\n\n <ng-template #paneTpl let-pane>\n @switch (pane.type) {\n @case ('splitPane') {\n <ng-container [ngTemplateOutlet]=\"splitTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @case ('tabGroupPane') {\n <ng-container [ngTemplateOutlet]=\"tabGroupTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @case ('documentHost') {\n <ng-container [ngTemplateOutlet]=\"documentHostTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @default {\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n }\n </ng-template>\n\n <!-- ─── the dock manager itself ─────────────────────────────────────── -->\n @if (maximized(); as pane) {\n <div class=\"absolute inset-0 z-30 flex\">\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n } @else {\n @if (unpinned().top.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n }\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n @if (unpinned().start.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'start' }\" />\n }\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: layout().rootPane }\" />\n </div>\n\n @if (unpinned().end.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'end' }\" />\n }\n </div>\n\n @if (unpinned().bottom.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n }\n\n <!-- The fly-out an unpinned pane opens over the layout. -->\n @if (flyout(); as pane) {\n <div data-dock-flyout [class]=\"flyoutClass()\" [style]=\"flyoutStyle(pane)\">\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n }\n\n @for (window of floatingPanes(); track key(window)) {\n <div\n [attr.data-dock-window]=\"key(window)\"\n [class]=\"floatingClass()\"\n [style]=\"floatingStyle(window)\"\n (pointerdown)=\"bringToFront(window)\"\n >\n <div\n [class]=\"titleBarClass()\"\n (pointerdown)=\"startPaneDrag(floatingContent(window), window, $event)\"\n (dblclick)=\"dockBack(window)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ floatingTitle(window) }}</span>\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n aria-label=\"Dock window\"\n (click)=\"dockBack(window); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matDockRound\" />\n </button>\n\n <!-- A one-pane window shows that pane's own actions; the header they\n would normally live in is suppressed below. -->\n @if (singlePane(window); as pane) {\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n } @else {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n aria-label=\"Close window\"\n (click)=\"closeWindow(window); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matCloseRound\" />\n </button>\n }\n </div>\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n @if (singlePane(window); as pane) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: pane, hideHeader: true }\"\n />\n } @else {\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: window }\" />\n }\n </div>\n\n @if (window.floatingResizable !== false) {\n @for (handle of RESIZE_HANDLES; track handle.id) {\n <div\n [class]=\"handle.class\"\n [attr.aria-hidden]=\"true\"\n (pointerdown)=\"startFloatingResize(window, handle.id, $event)\"\n ></div>\n }\n }\n </div>\n }\n }\n\n <!-- Where a drop would land. -->\n @if (dropRect(); as rect) {\n <div\n class=\"border-primary bg-primary/20 pointer-events-none absolute z-50 rounded-sm border-2\"\n [style.left.px]=\"rect.left\"\n [style.top.px]=\"rect.top\"\n [style.width.px]=\"rect.width\"\n [style.height.px]=\"rect.height\"\n ></div>\n }\n\n <!-- ─── the docking joystick and the outer ring ─────────────────────── -->\n @for (indicator of dockIndicators(); track indicator.key) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClass(indicator)\"\n [style.left.px]=\"indicator.left\"\n [style.top.px]=\"indicator.top\"\n [style.width.px]=\"INDICATOR_SIZE\"\n [style.height.px]=\"INDICATOR_SIZE\"\n >\n <span [class]=\"indicatorFillClass(indicator)\"></span>\n </div>\n }\n\n @if (dragGhost(); as ghost) {\n <div\n class=\"bg-surface-overlay border-border text-foreground pointer-events-none fixed z-60 rounded-md border px-2 py-1 text-xs shadow-lg\"\n [style.left.px]=\"ghost.x + 12\"\n [style.top.px]=\"ghost.y + 12\"\n >\n {{ ghost.label }}\n </div>\n }\n\n <!-- ─── an edge strip of collapsed panes ────────────────────────────── -->\n <ng-template #stripTpl let-location>\n <div data-dock-strip [class]=\"stripClass(location)\">\n @for (pane of unpinnedAt(location); track key(pane)) {\n <button\n type=\"button\"\n [class]=\"stripTabClass(location, pane)\"\n [attr.aria-expanded]=\"pane === flyout()\"\n (click)=\"toggleFlyout(pane)\"\n >\n {{ pane.header || pane.contentId }}\n </button>\n }\n </div>\n </ng-template>\n `,\n host: {\n '[class]': 'computedClass()',\n '(keydown.escape)': 'onEscape()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiDockManager implements XuiDockContentMounter {\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n private readonly document = this.el.ownerDocument;\n private readonly vcr = inject(ViewContainerRef);\n private readonly direction = injectXDirection();\n\n /** Detached parking space for the content views of panes that are not on screen. */\n private readonly holder = this.document.createElement('div');\n\n private readonly views = new Map<string, EmbeddedViewRef<unknown>>();\n\n // `descendants` so the templates may sit inside a wrapper element rather than\n // having to be immediate children.\n private readonly contents = contentChildren(XuiDockContent, { descendants: true });\n\n readonly class = input<ClassValue>('');\n\n /**\n * The layout tree. Two-way bindable, and edited **in place** — see the class\n * docs for why, and use `cloneDockLayout()` for snapshots.\n */\n readonly layout = model.required<XuiDockManagerLayout>();\n\n /** A pane was closed and removed from the layout. */\n readonly paneClose = output<XuiDockContentPane>();\n\n /** The pane the user last interacted with, or `null` once it is gone. */\n readonly activePaneChange = output<XuiDockContentPane | null>();\n\n readonly panePinnedChange = output<XuiDockPaneStateEvent>();\n readonly paneMaximizedChange = output<XuiDockPaneStateEvent>();\n readonly paneFloatingChange = output<XuiDockPaneStateEvent>();\n\n /** A pointer drag on a pane header or tab began. */\n readonly paneDragStart = output<XuiDockPane>();\n /** A pointer drag ended, whether or not it changed the layout. */\n readonly paneDragEnd = output<XuiDockPane>();\n\n /** The pane last interacted with. Drives the active header accent. */\n readonly activePane = signal<XuiDockContentPane | null>(null);\n\n private readonly drag = signal<DragState | null>(null);\n private readonly dropTarget = signal<DropTarget | null>(null);\n protected readonly dropRect = signal<Rect | null>(null);\n protected readonly dockIndicators = signal<DockIndicator[]>([]);\n\n /** The unpinned pane whose fly-out is open. */\n protected readonly flyout = signal<XuiDockContentPane | null>(null);\n\n protected readonly maximized = computed(() => findMaximizedPane(this.layout()));\n protected readonly unpinned = computed(() => unpinnedDockPanes(this.layout()));\n protected readonly floatingPanes = computed(() => this.layout().floatingPanes ?? []);\n\n protected readonly dragGhost = computed(() => {\n const state = this.drag();\n\n // A floating window drags itself, so it needs no ghost.\n return state && !state.window ? { x: state.x, y: state.y, label: this.headerOf(state.pane) } : null;\n });\n\n /** Exposed to the template so an indicator's box matches its hit area exactly. */\n protected readonly INDICATOR_SIZE = INDICATOR_SIZE;\n\n /** Exposed to the template; the ids double as the axis to resize along. */\n protected readonly RESIZE_HANDLES = [\n { id: 'top', class: 'absolute -top-1 inset-x-2 h-2 cursor-ns-resize' },\n { id: 'bottom', class: 'absolute -bottom-1 inset-x-2 h-2 cursor-ns-resize' },\n { id: 'left', class: 'absolute -left-1 inset-y-2 w-2 cursor-ew-resize' },\n { id: 'right', class: 'absolute -right-1 inset-y-2 w-2 cursor-ew-resize' },\n { id: 'top-left', class: 'absolute -top-1 -left-1 size-3 cursor-nwse-resize' },\n { id: 'top-right', class: 'absolute -top-1 -right-1 size-3 cursor-nesw-resize' },\n { id: 'bottom-left', class: 'absolute -bottom-1 -left-1 size-3 cursor-nesw-resize' },\n { id: 'bottom-right', class: 'absolute -right-1 -bottom-1 size-3 cursor-nwse-resize' }\n ] as const;\n\n constructor() {\n // Content views outlive the pane bodies they are mounted into, so they are\n // only destroyed once their pane leaves the layout for good.\n effect(() => {\n const live = new Set(collectContentPanes(this.layout()).map(pane => pane.contentId));\n\n for (const [contentId, view] of this.views) {\n if (!live.has(contentId)) {\n view.destroy();\n this.views.delete(contentId);\n }\n }\n\n const active = this.activePane();\n\n if (active && !live.has(active.contentId)) {\n this.activePane.set(null);\n this.activePaneChange.emit(null);\n }\n\n const flyout = this.flyout();\n\n if (flyout && (!live.has(flyout.contentId) || flyout.isPinned !== false)) {\n this.flyout.set(null);\n }\n });\n\n // A fly-out is a transient overlay: a pointer press anywhere that is not the\n // fly-out or an edge strip puts it away again.\n effect(onCleanup => {\n if (!this.flyout()) {\n return;\n }\n\n const onPointerDown = (event: Event): void => {\n if ((event.target as HTMLElement | null)?.closest('[data-dock-flyout], [data-dock-strip]')) {\n return;\n }\n\n this.flyout.set(null);\n };\n\n this.document.addEventListener('pointerdown', onPointerDown, true);\n onCleanup(() => this.document.removeEventListener('pointerdown', onPointerDown, true));\n });\n\n inject(DestroyRef).onDestroy(() => {\n for (const view of this.views.values()) {\n view.destroy();\n }\n\n this.views.clear();\n this.stopPointerTracking();\n });\n }\n\n // ─── content mounting ─────────────────────────────────────────────────────\n\n mountContent(contentId: string, host: HTMLElement): void {\n let view = this.views.get(contentId);\n\n if (!view) {\n const template = this.contents().find(content => content.contentId() === contentId)?.template;\n\n if (!template) {\n return;\n }\n\n view = this.vcr.createEmbeddedView(template);\n this.views.set(contentId, view);\n }\n\n for (const node of view.rootNodes as Node[]) {\n host.appendChild(node);\n }\n }\n\n releaseContent(contentId: string, host: HTMLElement): void {\n const view = this.views.get(contentId);\n\n if (!view) {\n return;\n }\n\n for (const node of view.rootNodes as Node[]) {\n if (node.parentNode === host) {\n this.holder.appendChild(node);\n }\n }\n }\n\n // ─── public API ───────────────────────────────────────────────────────────\n\n /** Remove `pane` from the layout. Respects `allowClose`. */\n closePane(pane: XuiDockContentPane): void {\n if (pane.allowClose === false) {\n return;\n }\n\n const layout = this.layout();\n\n if (removeDockPane(layout, pane)) {\n pane.isMaximized = false;\n this.commit();\n this.paneClose.emit(pane);\n }\n }\n\n /** Close every pane in a floating window. */\n closeWindow(window: XuiDockSplitPane): void {\n for (const pane of this.contentPanesOf(window)) {\n this.closePane(pane);\n }\n }\n\n /** Collapse `pane` to a tab on the nearest edge, keeping its place in the tree. */\n unpinPane(pane: XuiDockContentPane): void {\n if (pane.allowPinning === false || pane.documentOnly || pane.isPinned === false) {\n return;\n }\n\n // A pane inside a floating window has no edge to collapse to.\n if (this.isFloating(pane)) {\n this.dockBackPane(pane);\n }\n\n pane.isPinned = false;\n pane.isMaximized = false;\n this.flyout.set(null);\n this.commit();\n this.panePinnedChange.emit({ pane, value: false });\n }\n\n /** Restore `pane` to the position it was collapsed from. */\n pinPane(pane: XuiDockContentPane): void {\n if (pane.isPinned !== false) {\n return;\n }\n\n pane.isPinned = true;\n this.flyout.set(null);\n this.commit();\n this.panePinnedChange.emit({ pane, value: true });\n }\n\n togglePinned(pane: XuiDockContentPane): void {\n if (pane.isPinned === false) {\n this.pinPane(pane);\n } else {\n this.unpinPane(pane);\n }\n }\n\n /** Blow `pane` up to fill the whole dock manager, hiding everything else. */\n maximizePane(pane: XuiDockContentPane): void {\n if (pane.allowMaximize === false) {\n return;\n }\n\n for (const other of collectContentPanes(this.layout())) {\n other.isMaximized = other === pane;\n }\n\n this.commit();\n this.paneMaximizedChange.emit({ pane, value: true });\n }\n\n restorePane(pane: XuiDockContentPane): void {\n pane.isMaximized = false;\n this.commit();\n this.paneMaximizedChange.emit({ pane, value: false });\n }\n\n toggleMaximized(pane: XuiDockContentPane): void {\n if (pane.isMaximized) {\n this.restorePane(pane);\n } else {\n this.maximizePane(pane);\n }\n }\n\n /** Move `pane` into a floating window of its own. */\n floatPane(pane: XuiDockPane, location?: XuiDockPoint, size?: { width: number; height: number }): void {\n const rect = this.el.getBoundingClientRect();\n const fallback = { x: Math.round(rect.width / 4), y: Math.round(rect.height / 4) };\n\n if (isContentPane(pane)) {\n pane.isPinned = true;\n pane.isMaximized = false;\n }\n\n if (!floatDockPane(this.layout(), pane, location ?? fallback, size)) {\n return;\n }\n\n this.commit();\n\n for (const content of this.contentPanesOf(pane)) {\n this.paneFloatingChange.emit({ pane: content, value: true });\n }\n }\n\n /** Dock `pane` at `position` relative to `target`. */\n dockPane(pane: XuiDockPane, target: XuiDockPane, position: XuiDockPosition): boolean {\n const wasFloating = this.isFloating(pane);\n\n if (!dockPaneAt(this.layout(), pane, target, position)) {\n return false;\n }\n\n this.commit();\n\n if (wasFloating) {\n for (const content of this.contentPanesOf(pane)) {\n this.paneFloatingChange.emit({ pane: content, value: false });\n }\n }\n\n return true;\n }\n\n /** Make `pane` the active one, selecting its tab and opening its fly-out. */\n selectPane(pane: XuiDockContentPane): void {\n const group = this.tabGroupOf(pane);\n\n if (group) {\n group.selectedIndex = group.panes.indexOf(pane);\n this.commit();\n }\n\n if (pane.isPinned === false) {\n this.flyout.set(pane);\n }\n\n this.activate(pane);\n }\n\n // ─── template helpers ─────────────────────────────────────────────────────\n\n protected readonly key = dockPaneKey;\n\n protected childrenOf(pane: XuiDockPane): XuiDockPane[] {\n return visibleDockChildren(pane);\n }\n\n protected unpinnedAt(location: XuiDockUnpinnedLocation): XuiDockContentPane[] {\n return this.unpinned()[location];\n }\n\n protected pinnedTabs(group: XuiDockTabGroupPane): XuiDockContentPane[] {\n return group.panes.filter(pane => pane.isPinned !== false);\n }\n\n protected selectedTab(group: XuiDockTabGroupPane): XuiDockContentPane | null {\n return selectedTabPane(group);\n }\n\n protected flexOf(pane: XuiDockPane): string {\n return `${pane.size ?? 1} 1 0px`;\n }\n\n protected headerOf(pane: XuiDockPane): string {\n const contents = this.contentPanesOf(pane);\n\n return contents[0]?.header || contents[0]?.contentId || 'panes';\n }\n\n /** The pane a floating window's title bar drags: its lone pane, or the root. */\n protected floatingContent(window: XuiDockSplitPane): XuiDockPane {\n return this.singlePane(window) ?? window;\n }\n\n protected singlePane(window: XuiDockSplitPane): XuiDockContentPane | null {\n const only = window.panes.length === 1 ? window.panes[0] : null;\n\n return only && isContentPane(only) ? only : null;\n }\n\n protected floatingTitle(window: XuiDockSplitPane): string {\n const contents = this.contentPanesOf(window);\n\n if (contents.length === 1) {\n return contents[0].header || contents[0].contentId;\n }\n\n return `${contents.length} panes`;\n }\n\n protected isFloating(pane: XuiDockPane): boolean {\n const windows = this.layout().floatingPanes ?? [];\n\n return windows.some(window => window === pane || this.contentPanesOf(window).includes(pane as XuiDockContentPane));\n }\n\n protected toggleFlyout(pane: XuiDockContentPane): void {\n this.flyout.update(current => (current === pane ? null : pane));\n\n if (this.flyout()) {\n this.activate(pane);\n }\n }\n\n protected activate(pane: XuiDockContentPane): void {\n if (this.activePane() === pane) {\n return;\n }\n\n this.activePane.set(pane);\n this.activePaneChange.emit(pane);\n }\n\n protected onEscape(): void {\n if (this.drag()) {\n this.cancelDrag();\n return;\n }\n\n this.flyout.set(null);\n }\n\n /** Dock a whole floating window back into the layout root. */\n protected dockBack(window: XuiDockSplitPane): void {\n this.dockPane(window, this.layout().rootPane, 'end');\n }\n\n private dockBackPane(pane: XuiDockContentPane): void {\n this.dockPane(pane, this.layout().rootPane, 'end');\n }\n\n protected bringToFront(window: XuiDockSplitPane): void {\n const windows = this.layout().floatingPanes ?? [];\n\n if (windows[windows.length - 1] === window) {\n return;\n }\n\n this.layout().floatingPanes = [...windows.filter(other => other !== window), window];\n this.commit();\n }\n\n // ─── splitter resizing ────────────────────────────────────────────────────\n\n protected startSplitterDrag(parent: XuiDockSplitPane, gutter: number, event: PointerEvent): void {\n const gutterEl = event.currentTarget as HTMLElement;\n const beforeEl = gutterEl.previousElementSibling as HTMLElement | null;\n const afterEl = gutterEl.nextElementSibling as HTMLElement | null;\n\n if (!beforeEl || !afterEl) {\n return;\n }\n\n event.preventDefault();\n\n const vertical = parent.orientation === 'vertical';\n const children = this.childrenOf(parent);\n const before = children[gutter];\n const after = children[gutter + 1];\n const beforePx = vertical ? beforeEl.offsetHeight : beforeEl.offsetWidth;\n const afterPx = vertical ? afterEl.offsetHeight : afterEl.offsetWidth;\n const start = vertical ? event.clientY : event.clientX;\n\n // Dragging towards the inline end grows the leading pane; in RTL that is\n // leftwards, so the horizontal delta is negated.\n const sign = !vertical && this.direction() === 'rtl' ? -1 : 1;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const position = vertical ? moveEvent.clientY : moveEvent.clientX;\n const delta = this.clampSplitterDelta((position - start) * sign, beforePx, afterPx);\n\n this.resizeSiblings(before, after, beforePx + delta, beforePx + afterPx);\n };\n\n this.trackPointer(onMove);\n }\n\n protected onSplitterKeydown(parent: XuiDockSplitPane, gutter: number, event: KeyboardEvent): void {\n const vertical = parent.orientation === 'vertical';\n const arrow = arrowDirectionOnAxis(event.key, this.direction(), vertical ? 'vertical' : 'horizontal');\n const gutterEl = event.currentTarget as HTMLElement;\n const beforeEl = gutterEl.previousElementSibling as HTMLElement | null;\n const afterEl = gutterEl.nextElementSibling as HTMLElement | null;\n\n if (!arrow || !beforeEl || !afterEl) {\n return;\n }\n\n event.preventDefault();\n\n const children = this.childrenOf(parent);\n const beforePx = vertical ? beforeEl.offsetHeight : beforeEl.offsetWidth;\n const afterPx = vertical ? afterEl.offsetHeight : afterEl.offsetWidth;\n const step = (event.shiftKey ? 40 : 10) * (arrow === 'next' ? 1 : -1);\n const delta = this.clampSplitterDelta(step, beforePx, afterPx);\n\n this.resizeSiblings(children[gutter], children[gutter + 1], beforePx + delta, beforePx + afterPx);\n }\n\n private clampSplitterDelta(delta: number, beforePx: number, afterPx: number): number {\n return Math.max(MIN_PANE_SIZE - beforePx, Math.min(afterPx - MIN_PANE_SIZE, delta));\n }\n\n /** Re-weight two siblings so `before` takes `beforePx` of their shared `totalPx`. */\n private resizeSiblings(before: XuiDockPane, after: XuiDockPane, beforePx: number, totalPx: number): void {\n if (totalPx <= 0) {\n return;\n }\n\n const share = (before.size ?? 1) + (after.size ?? 1);\n\n before.size = (share * beforePx) / totalPx;\n after.size = share - before.size;\n this.commit({ normalize: false });\n }\n\n // ─── floating windows ─────────────────────────────────────────────────────\n\n protected startFloatingResize(window: XuiDockSplitPane, handle: string, event: PointerEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const startX = event.clientX;\n const startY = event.clientY;\n const origin = window.floatingLocation ?? FLOATING_ORIGIN;\n const width = window.floatingWidth ?? 400;\n const height = window.floatingHeight ?? 300;\n // In RTL the window is positioned from the right edge, so a rightward drag\n // moves its inline start the other way.\n const sign = this.direction() === 'rtl' ? -1 : 1;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const dx = (moveEvent.clientX - startX) * sign;\n const dy = moveEvent.clientY - startY;\n const location = { ...origin };\n let nextWidth = width;\n let nextHeight = height;\n\n if (handle.includes('left')) {\n nextWidth = Math.max(MIN_PANE_SIZE * 2, width - dx);\n location.x = origin.x + (width - nextWidth);\n } else if (handle.includes('right')) {\n nextWidth = Math.max(MIN_PANE_SIZE * 2, width + dx);\n }\n\n if (handle.includes('top')) {\n nextHeight = Math.max(MIN_PANE_SIZE * 2, height - dy);\n location.y = origin.y + (height - nextHeight);\n } else if (handle.includes('bottom')) {\n nextHeight = Math.max(MIN_PANE_SIZE * 2, height + dy);\n }\n\n window.floatingLocation = location;\n window.floatingWidth = nextWidth;\n window.floatingHeight = nextHeight;\n this.commit({ normalize: false });\n };\n\n this.trackPointer(onMove);\n }\n\n // ─── dragging panes and docking ───────────────────────────────────────────\n\n /**\n * Start a drag on a pane header, a tab, or a floating window's title bar.\n *\n * A window drag moves the window as it goes and docks it if it is released over\n * a valid target; a pane drag shows a ghost and either docks the pane or floats\n * it where it was dropped.\n */\n protected startPaneDrag(pane: XuiDockPane, window: XuiDockSplitPane | null, event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n const startX = event.clientX;\n const startY = event.clientY;\n const origin = window?.floatingLocation ?? FLOATING_ORIGIN;\n const sign = this.direction() === 'rtl' ? -1 : 1;\n let started = false;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const dx = moveEvent.clientX - startX;\n const dy = moveEvent.clientY - startY;\n\n if (!started) {\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD) {\n return;\n }\n\n started = true;\n this.paneDragStart.emit(pane);\n }\n\n if (window) {\n window.floatingLocation = { x: origin.x + dx * sign, y: origin.y + dy };\n this.commit({ normalize: false });\n }\n\n this.drag.set({ pane, window, x: moveEvent.clientX, y: moveEvent.clientY });\n this.updateDropTarget(moveEvent.clientX, moveEvent.clientY);\n };\n\n const onUp = (upEvent: PointerEvent): void => {\n if (!started) {\n return;\n }\n\n const target = this.dropTarget();\n this.clearDrag();\n\n if (target) {\n this.dockPane(pane, target.pane, target.position);\n } else if (!window) {\n this.floatAtPointer(pane, upEvent.clientX, upEvent.clientY);\n }\n\n this.paneDragEnd.emit(pane);\n };\n\n this.trackPointer(onMove, onUp);\n }\n\n protected cancelDrag(): void {\n const state = this.drag();\n\n this.clearDrag();\n this.stopPointerTracking();\n\n if (state) {\n this.paneDragEnd.emit(state.pane);\n }\n }\n\n private clearDrag(): void {\n this.drag.set(null);\n this.dropTarget.set(null);\n this.dropRect.set(null);\n this.dockIndicators.set([]);\n }\n\n private floatAtPointer(pane: XuiDockPane, clientX: number, clientY: number): void {\n const rect = this.el.getBoundingClientRect();\n const inlineOffset = this.direction() === 'rtl' ? rect.right - clientX : clientX - rect.left;\n\n this.floatPane(pane, { x: Math.round(inlineOffset - 40), y: Math.round(clientY - rect.top - 12) });\n }\n\n /**\n * Work out where a drop at these coordinates would land, and size the preview\n * rectangle to match.\n *\n * The dock manager's own edges win over whatever pane happens to be under the\n * pointer, so there is always a way to dock against the full height or width of\n * the layout.\n */\n private updateDropTarget(clientX: number, clientY: number): void {\n const state = this.drag();\n\n if (!state) {\n return;\n }\n\n const hostRect = this.el.getBoundingClientRect();\n const hovered = this.paneAt(clientX, clientY);\n const indicators = this.buildIndicators(state.pane, hovered, hostRect);\n const x = clientX - hostRect.left;\n const y = clientY - hostRect.top;\n\n // Landing on an indicator is an explicit choice and always wins.\n const hit = indicators.find(\n indicator =>\n x >= indicator.left &&\n x <= indicator.left + INDICATOR_SIZE &&\n y >= indicator.top &&\n y <= indicator.top + INDICATOR_SIZE\n );\n\n const target = hit\n ? { pane: hit.pane, position: hit.position }\n : this.looseTargetAt(state, hovered, clientX, clientY);\n\n this.dockIndicators.set(\n indicators.map(indicator => ({\n ...indicator,\n active: !!target && indicator.pane === target.pane && indicator.position === target.position\n }))\n );\n\n if (!target) {\n this.dropTarget.set(null);\n this.dropRect.set(null);\n return;\n }\n\n const rect = this.elementForPane(target.pane)?.getBoundingClientRect() ?? hostRect;\n\n this.dropTarget.set(target);\n this.dropRect.set(this.previewRect(rect, hostRect, target.position));\n }\n\n /**\n * The target for a drop that missed every indicator.\n *\n * A header or tab drag has no purpose other than docking, so the whole pane\n * stays live and the nearest edge wins. Dragging a floating window is mostly\n * about *moving* it, so it docks from the indicators alone.\n */\n private looseTargetAt(\n state: DragState,\n hovered: XuiDockPane | null,\n clientX: number,\n clientY: number\n ): DropTarget | null {\n if (state.window) {\n return null;\n }\n\n const hostRect = this.el.getBoundingClientRect();\n const target = this.outerEdgeAt(clientX, clientY, hostRect) ?? this.zoneTargetAt(hovered, clientX, clientY);\n\n return target && canDockInto(this.layout(), state.pane, target.pane, target.position) ? target : null;\n }\n\n /**\n * The joystick over the pane under the pointer, plus the outer ring that docks\n * against the whole layout — Visual Studio's docking targets.\n *\n * Only the positions the dragged pane is actually allowed to take are built, so\n * a document dragged over a tool window simply offers nothing.\n */\n private buildIndicators(dragged: XuiDockPane, hovered: XuiDockPane | null, hostRect: DOMRect): DockIndicator[] {\n const ltr = this.direction() !== 'rtl';\n const root = this.layout().rootPane;\n const step = INDICATOR_SIZE + INDICATOR_GAP;\n const half = INDICATOR_SIZE / 2;\n const far = INDICATOR_INSET + INDICATOR_SIZE;\n const candidates: Omit<DockIndicator, 'active' | 'key'>[] = [];\n\n const push = (pane: XuiDockPane, side: DockIndicator['side'], left: number, top: number): void => {\n const position: XuiDockPosition =\n side === 'center'\n ? 'center'\n : side === 'top' || side === 'bottom'\n ? side\n : (side === 'left') === ltr\n ? 'start'\n : 'end';\n\n if (canDockInto(this.layout(), dragged, pane, position)) {\n candidates.push({ pane, position, side, left, top });\n }\n };\n\n // The outer ring, pinned to the middle of each of the dock manager's edges.\n push(root, 'top', hostRect.width / 2 - half, INDICATOR_INSET);\n push(root, 'bottom', hostRect.width / 2 - half, hostRect.height - far);\n push(root, 'left', INDICATOR_INSET, hostRect.height / 2 - half);\n push(root, 'right', hostRect.width - far, hostRect.height / 2 - half);\n\n if (hovered) {\n const rect = this.elementForPane(hovered)?.getBoundingClientRect();\n\n if (rect && rect.width >= INDICATOR_MIN_PANE && rect.height >= INDICATOR_MIN_PANE) {\n const left = rect.left - hostRect.left + rect.width / 2 - half;\n const top = rect.top - hostRect.top + rect.height / 2 - half;\n\n push(hovered, 'center', left, top);\n push(hovered, 'left', left - step, top);\n push(hovered, 'right', left + step, top);\n push(hovered, 'top', left, top - step);\n push(hovered, 'bottom', left, top + step);\n }\n }\n\n return candidates.map(candidate => ({\n ...candidate,\n key: `${dockPaneKey(candidate.pane)}-${candidate.position}-${candidate.side}`,\n active: false\n }));\n }\n\n /** A drop within `OUTER_EDGE` of the dock manager's frame docks the whole layout. */\n private outerEdgeAt(clientX: number, clientY: number, hostRect: DOMRect): DropTarget | null {\n if (clientX < hostRect.left || clientX > hostRect.right || clientY < hostRect.top || clientY > hostRect.bottom) {\n return null;\n }\n\n const root = this.layout().rootPane;\n const ltr = this.direction() !== 'rtl';\n\n if (clientX - hostRect.left < OUTER_EDGE) {\n return { pane: root, position: ltr ? 'start' : 'end' };\n }\n\n if (hostRect.right - clientX < OUTER_EDGE) {\n return { pane: root, position: ltr ? 'end' : 'start' };\n }\n\n if (clientY - hostRect.top < OUTER_EDGE) {\n return { pane: root, position: 'top' };\n }\n\n if (hostRect.bottom - clientY < OUTER_EDGE) {\n return { pane: root, position: 'bottom' };\n }\n\n return null;\n }\n\n /**\n * The pane under the pointer.\n *\n * Hit-tested against the rendered rectangles rather than `elementFromPoint`, so\n * the drag ghost, the indicators and the floating window riding along with the\n * pointer cannot get in the way. The innermost rectangle wins, and on a tie the\n * one painted last does.\n */\n private paneAt(clientX: number, clientY: number): XuiDockPane | null {\n const dragged = this.drag()?.window;\n const draggedEl = dragged ? this.el.querySelector(`[data-dock-window=\"${dockPaneKey(dragged)}\"]`) : null;\n let element: HTMLElement | null = null;\n let smallest = Number.POSITIVE_INFINITY;\n\n for (const candidate of this.el.querySelectorAll<HTMLElement>('[data-dock-key]')) {\n // A collapsed pane's fly-out is a transient overlay, not a dock.\n if (draggedEl?.contains(candidate) || candidate.closest('[data-dock-flyout]')) {\n continue;\n }\n\n const bounds = candidate.getBoundingClientRect();\n\n if (\n clientX < bounds.left ||\n clientX > bounds.right ||\n clientY < bounds.top ||\n clientY > bounds.bottom ||\n bounds.width * bounds.height > smallest\n ) {\n continue;\n }\n\n element = candidate;\n smallest = bounds.width * bounds.height;\n }\n\n return element ? this.paneForKey(element.dataset['dockKey'] ?? '') : null;\n }\n\n /** Split `pane` along whichever edge the pointer sits nearest, or tab at its centre. */\n private zoneTargetAt(pane: XuiDockPane | null, clientX: number, clientY: number): DropTarget | null {\n const rect = pane && this.elementForPane(pane)?.getBoundingClientRect();\n\n if (!pane || !rect) {\n return null;\n }\n\n const u = rect.width ? (clientX - rect.left) / rect.width : 0.5;\n const v = rect.height ? (clientY - rect.top) / rect.height : 0.5;\n\n if (u > CENTRE_ZONE && u < 1 - CENTRE_ZONE && v > CENTRE_ZONE && v < 1 - CENTRE_ZONE) {\n return { pane, position: 'center' };\n }\n\n const ltr = this.direction() !== 'rtl';\n const edges = [\n { position: (ltr ? 'start' : 'end') as XuiDockPosition, fraction: u },\n { position: (ltr ? 'end' : 'start') as XuiDockPosition, fraction: 1 - u },\n { position: 'top' as XuiDockPosition, fraction: v },\n { position: 'bottom' as XuiDockPosition, fraction: 1 - v }\n ];\n\n return { pane, position: edges.reduce((a, b) => (b.fraction < a.fraction ? b : a)).position };\n }\n\n /** The slice of `rect` a drop would occupy, in coordinates relative to the host. */\n private previewRect(rect: DOMRect, hostRect: DOMRect, position: XuiDockPosition): Rect {\n const left = rect.left - hostRect.left;\n const top = rect.top - hostRect.top;\n const ltr = this.direction() !== 'rtl';\n const half = { width: rect.width / 2, height: rect.height / 2 };\n\n switch (position) {\n case 'center':\n return { left, top, width: rect.width, height: rect.height };\n case 'top':\n return { left, top, width: rect.width, height: half.height };\n case 'bottom':\n return { left, top: top + half.height, width: rect.width, height: half.height };\n case 'start':\n return { left: ltr ? left : left + half.width, top, width: half.width, height: rect.height };\n case 'end':\n return { left: ltr ? left + half.width : left, top, width: half.width, height: rect.height };\n }\n }\n\n private elementForPane(pane: XuiDockPane): HTMLElement | null {\n return this.el.querySelector<HTMLElement>(`[data-dock-key=\"${dockPaneKey(pane)}\"]`);\n }\n\n private paneForKey(key: string): XuiDockPane | null {\n let found: XuiDockPane | null = null;\n\n const walk = (pane: XuiDockPane): void => {\n if (dockPaneKey(pane) === key) {\n found = pane;\n return;\n }\n\n if (isSplitPane(pane) || isTabGroupPane(pane)) {\n pane.panes.forEach(walk);\n } else if (isDocumentHost(pane)) {\n walk(pane.rootPane);\n }\n };\n\n const layout = this.layout();\n\n for (const root of [layout.rootPane, ...(layout.floatingPanes ?? [])]) {\n if (found) {\n break;\n }\n\n walk(root);\n }\n\n return found;\n }\n\n // ─── pointer plumbing ─────────────────────────────────────────────────────\n\n private release: (() => void) | null = null;\n\n /** Follow the pointer until it is released, then clean up after ourselves. */\n private trackPointer(onMove: (event: PointerEvent) => void, onUp?: (event: PointerEvent) => void): void {\n this.stopPointerTracking();\n\n const move = (event: PointerEvent): void => onMove(event);\n const up = (event: PointerEvent): void => {\n this.stopPointerTracking();\n onUp?.(event);\n };\n\n this.document.addEventListener('pointermove', move);\n this.document.addEventListener('pointerup', up);\n this.document.addEventListener('pointercancel', up);\n\n this.release = () => {\n this.document.removeEventListener('pointermove', move);\n this.document.removeEventListener('pointerup', up);\n this.document.removeEventListener('pointercancel', up);\n };\n }\n\n private stopPointerTracking(): void {\n this.release?.();\n this.release = null;\n }\n\n // ─── layout bookkeeping ───────────────────────────────────────────────────\n\n /**\n * Publish the in-place edits made to the tree.\n *\n * Skip normalisation for the continuous gestures — a resize or a window move\n * cannot change the tree's shape, and re-walking it on every pointer event is\n * wasted work.\n */\n private commit(options?: { normalize?: boolean }): void {\n const layout = this.layout();\n\n if (options?.normalize !== false) {\n normalizeDockLayout(layout);\n }\n\n this.layout.set({ ...layout });\n }\n\n private contentPanesOf(pane: XuiDockPane): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n out.push(current);\n } else if (isSplitPane(current) || isTabGroupPane(current)) {\n current.panes.forEach(walk);\n } else if (isDocumentHost(current)) {\n walk(current.rootPane);\n }\n };\n\n walk(pane);\n\n return out;\n }\n\n private tabGroupOf(pane: XuiDockContentPane): XuiDockTabGroupPane | null {\n let group: XuiDockTabGroupPane | null = null;\n\n const walk = (current: XuiDockPane): void => {\n if (group) {\n return;\n }\n\n if (isTabGroupPane(current)) {\n if (current.panes.includes(pane)) {\n group = current;\n return;\n }\n\n return;\n }\n\n if (isSplitPane(current)) {\n current.panes.forEach(walk);\n } else if (isDocumentHost(current)) {\n walk(current.rootPane);\n }\n };\n\n const layout = this.layout();\n\n for (const root of [layout.rootPane, ...(layout.floatingPanes ?? [])]) {\n walk(root);\n }\n\n return group;\n }\n\n // ─── keyboard ─────────────────────────────────────────────────────────────\n\n protected onTabKeydown(group: XuiDockTabGroupPane, event: KeyboardEvent): void {\n const tabs = this.pinnedTabs(group);\n\n if (!tabs.length) {\n return;\n }\n\n const step = arrowDirectionOnAxis(event.key, this.direction(), 'horizontal');\n const current = tabs.indexOf(this.selectedTab(group) as XuiDockContentPane);\n let next: number;\n\n if (step === 'next') {\n next = (current + 1) % tabs.length;\n } else if (step === 'previous') {\n next = (current - 1 + tabs.length) % tabs.length;\n } else if (event.key === 'Home') {\n next = 0;\n } else if (event.key === 'End') {\n next = tabs.length - 1;\n } else {\n return;\n }\n\n event.preventDefault();\n this.selectPane(tabs[next]);\n\n // Roving tabindex: follow the selection with focus.\n const strip = (event.currentTarget as HTMLElement).parentElement;\n strip?.querySelectorAll<HTMLElement>('[role=\"tab\"]')[next]?.focus();\n }\n\n // ─── classes ──────────────────────────────────────────────────────────────\n\n protected readonly computedClass = computed(() =>\n xui('bg-surface text-foreground relative flex flex-col overflow-hidden text-sm select-none', this.class())\n );\n\n protected splitClass(pane: XuiDockPane): string {\n return xui('flex min-h-0 min-w-0 flex-1', isSplitPane(pane) && pane.orientation === 'vertical' && 'flex-col');\n }\n\n protected frameClass(pane: XuiDockPane): string {\n return xui(\n 'border-border bg-surface flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-md border',\n this.isActiveFrame(pane) && 'border-primary-muted'\n );\n }\n\n /** Whether the pane on screen in this frame is the active one. */\n private isActiveFrame(pane: XuiDockPane): boolean {\n const active = this.activePane();\n\n if (!active) {\n return false;\n }\n\n return isTabGroupPane(pane) ? this.selectedTab(pane) === active : pane === active;\n }\n\n protected headerClass(pane: XuiDockPane): string {\n return xui(\n 'border-border bg-surface-raised text-foreground-muted flex h-8 shrink-0 items-center gap-1 border-b ps-2 pe-1',\n 'text-xs font-medium',\n // The header is a drag handle; without this a touch drag scrolls the page\n // instead of moving the pane.\n 'touch-none',\n isContentPane(pane) && 'cursor-grab'\n );\n }\n\n protected tabStripClass(): string {\n return xui('border-border bg-surface-raised flex h-8 shrink-0 touch-none items-center gap-0.5 border-b px-1');\n }\n\n protected tabClass(group: XuiDockTabGroupPane, tab: XuiDockContentPane): string {\n return xui(\n 'group relative flex h-8 max-w-40 shrink-0 cursor-grab items-center gap-1 rounded-t px-2 text-xs',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus',\n tab === this.selectedTab(group)\n ? 'bg-surface text-foreground border-border border-x border-t'\n : 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground'\n );\n }\n\n protected tabCloseClass(): string {\n return xui('hover:bg-hover-overlay grid size-4 shrink-0 place-items-center rounded opacity-60 hover:opacity-100');\n }\n\n protected actionClass(): string {\n return xui(\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground grid size-6 shrink-0 place-items-center',\n 'rounded focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus'\n );\n }\n\n protected gutterClass(pane: XuiDockPane): string {\n return xui(\n 'group relative z-10 flex shrink-0 touch-none items-center justify-center',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus',\n isSplitPane(pane) && pane.orientation === 'vertical'\n ? 'h-1.5 w-full cursor-row-resize'\n : 'w-1.5 cursor-col-resize'\n );\n }\n\n protected gutterHandleClass(pane: XuiDockPane): string {\n return xui(\n 'bg-border group-hover:bg-primary rounded-full transition-colors',\n isSplitPane(pane) && pane.orientation === 'vertical' ? 'h-0.5 w-8' : 'h-8 w-0.5'\n );\n }\n\n protected stripClass(location: XuiDockUnpinnedLocation): string {\n const vertical = location === 'start' || location === 'end';\n\n return xui(\n 'border-border bg-surface-inset flex shrink-0 items-start gap-1 p-1',\n vertical ? 'w-8 flex-col' : 'h-8',\n location === 'start' && 'border-e',\n location === 'end' && 'border-s',\n location === 'top' && 'border-b',\n location === 'bottom' && 'border-t'\n );\n }\n\n protected stripTabClass(location: XuiDockUnpinnedLocation, pane: XuiDockContentPane): string {\n const vertical = location === 'start' || location === 'end';\n\n return xui(\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground max-h-40 max-w-40 truncate rounded px-1.5 py-1',\n 'text-xs focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus',\n vertical && '[writing-mode:vertical-rl]',\n pane === this.flyout() && 'bg-primary-muted text-foreground'\n );\n }\n\n protected flyoutClass(): string {\n return xui('bg-surface border-border absolute z-20 flex overflow-hidden border shadow-lg');\n }\n\n protected flyoutStyle(pane: XuiDockContentPane): Record<string, string> {\n const location = pane.unpinnedLocation ?? defaultUnpinnedLocation(this.layout(), pane);\n const size = `${pane.unpinnedSize ?? 280}px`;\n const offset = `${STRIP_SIZE}px`;\n\n switch (location) {\n case 'start':\n return { insetInlineStart: offset, top: '0', bottom: '0', width: size };\n case 'end':\n return { insetInlineEnd: offset, top: '0', bottom: '0', width: size };\n case 'top':\n return { top: offset, insetInlineStart: '0', insetInlineEnd: '0', height: size };\n case 'bottom':\n return { bottom: offset, insetInlineStart: '0', insetInlineEnd: '0', height: size };\n }\n }\n\n protected floatingClass(): string {\n return xui('bg-surface border-border absolute z-40 flex flex-col overflow-hidden rounded-lg border shadow-xl');\n }\n\n protected floatingStyle(window: XuiDockSplitPane): Record<string, string> {\n const location = window.floatingLocation ?? FLOATING_ORIGIN;\n\n return {\n insetInlineStart: `${location.x}px`,\n top: `${location.y}px`,\n width: `${window.floatingWidth ?? 400}px`,\n height: `${window.floatingHeight ?? 300}px`\n };\n }\n\n protected indicatorClass(indicator: DockIndicator): string {\n return xui(\n // Never interactive: the pointer is already captured by the drag, and the\n // indicators are hit-tested by rectangle rather than by event target.\n 'bg-surface-overlay pointer-events-none absolute z-55 rounded border shadow-md',\n indicator.active ? 'border-primary' : 'border-border-strong'\n );\n }\n\n /**\n * The shaded block inside an indicator, showing which part of the target the\n * pane will take — the same visual language as Visual Studio's dock targets.\n */\n protected indicatorFillClass(indicator: DockIndicator): string {\n const sides: Record<DockIndicator['side'], string> = {\n center: 'inset-1',\n left: 'top-1 bottom-1 left-1 w-1/3',\n right: 'top-1 bottom-1 right-1 w-1/3',\n top: 'top-1 right-1 left-1 h-1/3',\n bottom: 'right-1 bottom-1 left-1 h-1/3'\n };\n\n return xui(\n 'absolute rounded-sm',\n sides[indicator.side],\n indicator.active ? 'bg-primary' : 'bg-foreground-subtle/50'\n );\n }\n\n protected titleBarClass(): string {\n return xui(\n 'border-border bg-surface-raised text-foreground-muted flex h-7 shrink-0 cursor-grab items-center gap-1',\n 'touch-none border-b ps-2 pe-1 text-xs font-medium'\n );\n }\n}\n","import { XuiDockContent } from './lib/dock-content';\nimport { XuiDockManager } from './lib/dock-manager';\n\nexport * from './lib/dock-content';\nexport * from './lib/dock-manager';\nexport * from './lib/dock-manager.types';\nexport * from './lib/dock-manager.utils';\n\nexport const XuiDockManagerImports = [XuiDockManager, XuiDockContent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;AAkBG;MAEU,cAAc,CAAA;;IAEhB,SAAS,GAAG,KAAK,CAAC,QAAQ,gFAAW,KAAK,EAAE,gBAA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AA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9gBtE,qBAAqB,GAAG,CAAC,cAAc,EAAE,cAAc;;ACRpE;;AAEG;;;;"}
1
+ {"version":3,"file":"xui-dock-manager.mjs","sources":["../../../../../../libs/ui/dock-manager/xui/src/lib/dock-content.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.types.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.utils.ts","../../../../../../libs/ui/dock-manager/xui/src/lib/dock-manager.ts","../../../../../../libs/ui/dock-manager/xui/src/index.ts","../../../../../../libs/ui/dock-manager/xui/src/xui-dock-manager.ts"],"sourcesContent":["import { Directive, ElementRef, InjectionToken, TemplateRef, effect, inject, input } from '@angular/core';\n\n/**\n * Declares the body of one content pane.\n *\n * The `contentId` links the template to the `contentId` of a\n * {@link XuiDockContentPane} in the layout — the dock manager's equivalent of\n * Ignite UI's `slot=\"…\"` children.\n *\n * ```html\n * <xui-dock-manager [(layout)]=\"layout\">\n * <ng-template xuiDockContent=\"explorer\">…</ng-template>\n * <ng-template xuiDockContent=\"editor\">…</ng-template>\n * </xui-dock-manager>\n * ```\n *\n * The template is instantiated once, the first time its pane is shown, and the\n * resulting view is then kept for as long as the pane is in the layout — docking,\n * floating, unpinning and tab switching all move its DOM rather than rebuilding\n * it, so scroll offsets, half-typed input and component state survive.\n */\n@Directive({ selector: 'ng-template[xuiDockContent]', exportAs: 'xuiDockContent' })\nexport class XuiDockContent {\n /** Matches the `contentId` of a content pane in the layout. */\n readonly contentId = input.required<string>({ alias: 'xuiDockContent' });\n\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n/** What {@link XuiDockContentOutlet} needs from the dock manager above it. */\nexport interface XuiDockContentMounter {\n /** Move the view for `contentId` into `host`, creating it on first use. */\n mountContent(contentId: string, host: HTMLElement): void;\n\n /** Park the view for `contentId` if — and only if — it still sits in `host`. */\n releaseContent(contentId: string, host: HTMLElement): void;\n}\n\nexport const XUI_DOCK_CONTENT_MOUNTER = new InjectionToken<XuiDockContentMounter>('XuiDockContentMounter');\n\n/**\n * Fills its host element with the content view for a `contentId`.\n *\n * Used internally by `xui-dock-manager` wherever a pane body is rendered.\n */\n@Directive({ selector: '[xuiDockContentOutlet]', exportAs: 'xuiDockContentOutlet' })\nexport class XuiDockContentOutlet {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n private readonly mounter = inject(XUI_DOCK_CONTENT_MOUNTER);\n\n readonly contentId = input.required<string>({ alias: 'xuiDockContentOutlet' });\n\n constructor() {\n effect(onCleanup => {\n const contentId = this.contentId();\n this.mounter.mountContent(contentId, this.host);\n\n // Angular gives no ordering guarantee between the old outlet's cleanup and\n // the new outlet's mount, so release is conditional on the nodes still\n // being here — otherwise a re-layout could pull content out of the element\n // that just claimed it.\n onCleanup(() => this.mounter.releaseContent(contentId, this.host));\n });\n }\n}\n","/**\n * The dock manager's layout is a plain, serialisable tree — the same shape Ignite\n * UI's `IgcDockManagerLayout` uses, so layouts port across with only the `Igc`\n * prefix dropped. Nothing in the tree holds a DOM reference or an Angular type,\n * which is what makes a layout safe to persist and restore.\n */\n\n/** Discriminator for the four node kinds a layout tree is built from. */\nexport type XuiDockPaneType = 'splitPane' | 'contentPane' | 'tabGroupPane' | 'documentHost';\n\n/** Which axis a split pane lays its children out along. */\nexport type XuiDockSplitOrientation = 'horizontal' | 'vertical';\n\n/**\n * Where a dragged pane lands relative to the pane it was dropped on. `start` and\n * `end` are inline-relative, so they follow the reading direction.\n */\nexport type XuiDockPosition = 'start' | 'end' | 'top' | 'bottom' | 'center';\n\n/** Which edge of the dock manager an unpinned pane's tab sits on. */\nexport type XuiDockUnpinnedLocation = 'start' | 'end' | 'top' | 'bottom';\n\n/** A floating pane's top-left corner, in pixels relative to the dock manager. */\nexport interface XuiDockPoint {\n x: number;\n y: number;\n}\n\ninterface XuiDockPaneBase {\n /**\n * The pane's share of its parent split pane's main axis, as a weight relative\n * to its siblings — two children sized `1` and `3` split the space 25/75.\n * Defaults to `1`.\n */\n size?: number;\n}\n\n/**\n * A leaf pane: a header and a body, where the body is whichever\n * `[xuiDockContent]` template declares the matching `contentId`.\n */\nexport interface XuiDockContentPane extends XuiDockPaneBase {\n type: 'contentPane';\n\n /** Links the pane to its `<ng-template [xuiDockContent]=\"…\">`. Must be unique. */\n contentId: string;\n\n /** Text shown in the pane header, or in its tab when it sits in a tab group. */\n header?: string;\n\n /**\n * `false` collapses the pane to a tab on one of the dock manager's edges; its\n * position in the tree is kept, so re-pinning puts it back where it was.\n * Defaults to `true`.\n */\n isPinned?: boolean;\n\n /** Which edge an unpinned pane's tab sits on. Derived from the tree when unset. */\n unpinnedLocation?: XuiDockUnpinnedLocation;\n\n /** Thickness of the fly-out an unpinned pane opens, in pixels. Defaults to 280. */\n unpinnedSize?: number;\n\n /** `true` fills the whole dock manager, hiding every other pane. */\n isMaximized?: boolean;\n\n /**\n * Restricts the pane to the document host — it cannot be docked outside one,\n * floated or unpinned. Use it for editor-style tabs.\n */\n documentOnly?: boolean;\n\n /** Show the close button and allow programmatic closing. Defaults to `true`. */\n allowClose?: boolean;\n /** Allow the pane to be dragged out of the layout into a floating window. Defaults to `true`. */\n allowFloating?: boolean;\n /** Allow the pane to be dragged and docked elsewhere in the layout. Defaults to `true`. */\n allowDocking?: boolean;\n /** Show the pin button. Defaults to `true`. */\n allowPinning?: boolean;\n /** Show the maximize button. Defaults to `true`. */\n allowMaximize?: boolean;\n}\n\n/**\n * Lays its children out along one axis with a draggable splitter between each\n * pair. Doubles as the root of a floating window, which is where the `floating*`\n * properties apply.\n */\nexport interface XuiDockSplitPane extends XuiDockPaneBase {\n type: 'splitPane';\n orientation: XuiDockSplitOrientation;\n panes: XuiDockPane[];\n\n /**\n * Keep the split pane in the tree once its last child is gone. Needed on a\n * document host's root pane, which must survive closing every document.\n */\n allowEmpty?: boolean;\n\n /** Top-left corner of the floating window, when this is a floating root. */\n floatingLocation?: XuiDockPoint;\n /** Floating window width in pixels. Defaults to 400. */\n floatingWidth?: number;\n /** Floating window height in pixels. Defaults to 300. */\n floatingHeight?: number;\n /** Show resize handles on the floating window. Defaults to `true`. */\n floatingResizable?: boolean;\n}\n\n/** Stacks content panes as tabs, showing one at a time. */\nexport interface XuiDockTabGroupPane extends XuiDockPaneBase {\n type: 'tabGroupPane';\n panes: XuiDockContentPane[];\n\n /** Index of the visible tab. Defaults to 0, and is clamped to the tab count. */\n selectedIndex?: number;\n\n /** Keep the tab group in the tree once its last tab is gone. */\n allowEmpty?: boolean;\n}\n\n/**\n * The area `documentOnly` panes live in — the editor surface of an IDE layout.\n * A layout has at most one, and it is the only valid drop target for documents.\n */\nexport interface XuiDockDocumentHost extends XuiDockPaneBase {\n type: 'documentHost';\n rootPane: XuiDockSplitPane;\n}\n\n/** Any node in the layout tree. */\nexport type XuiDockPane = XuiDockContentPane | XuiDockSplitPane | XuiDockTabGroupPane | XuiDockDocumentHost;\n\n/** A pane that holds children, and so can be a docking target for `center`. */\nexport type XuiDockParentPane = XuiDockSplitPane | XuiDockTabGroupPane;\n\n/** The whole layout: one docked tree plus any number of floating windows. */\nexport interface XuiDockManagerLayout {\n rootPane: XuiDockSplitPane | XuiDockDocumentHost;\n\n /** Each entry is the root of one floating window. */\n floatingPanes?: XuiDockSplitPane[];\n}\n\n/** Emitted whenever a pane's pinned, maximized or floating state is toggled. */\nexport interface XuiDockPaneStateEvent {\n pane: XuiDockContentPane;\n value: boolean;\n}\n\nexport function isContentPane(pane: XuiDockPane): pane is XuiDockContentPane {\n return pane.type === 'contentPane';\n}\n\nexport function isSplitPane(pane: XuiDockPane): pane is XuiDockSplitPane {\n return pane.type === 'splitPane';\n}\n\nexport function isTabGroupPane(pane: XuiDockPane): pane is XuiDockTabGroupPane {\n return pane.type === 'tabGroupPane';\n}\n\nexport function isDocumentHost(pane: XuiDockPane): pane is XuiDockDocumentHost {\n return pane.type === 'documentHost';\n}\n\nexport function isParentPane(pane: XuiDockPane): pane is XuiDockParentPane {\n return pane.type === 'splitPane' || pane.type === 'tabGroupPane';\n}\n","import {\n isContentPane,\n isDocumentHost,\n isParentPane,\n isSplitPane,\n isTabGroupPane,\n type XuiDockContentPane,\n type XuiDockDocumentHost,\n type XuiDockManagerLayout,\n type XuiDockPane,\n type XuiDockParentPane,\n type XuiDockPoint,\n type XuiDockPosition,\n type XuiDockSplitOrientation,\n type XuiDockSplitPane,\n type XuiDockTabGroupPane,\n type XuiDockUnpinnedLocation\n} from './dock-manager.types';\n\n/**\n * Tree operations over a {@link XuiDockManagerLayout}.\n *\n * Every mutating function works **in place** on the layout object it is given and\n * leaves the pane objects themselves identity-stable: docking a pane re-parents\n * the very same object rather than a copy. The dock manager depends on that — it\n * keys rendered panes, cached content views and drag targets off object identity,\n * so a pane keeps its DOM (and therefore its scroll position, form state and\n * focus) as it moves around the layout.\n *\n * Callers that need an undo buffer should snapshot with {@link cloneDockLayout}\n * before mutating.\n */\n\nconst paneKeys = new WeakMap<XuiDockPane, string>();\nlet nextPaneKey = 0;\n\n/**\n * A stable string key for a pane object, allocated on first use.\n *\n * Used for `@for` tracking and for finding the pane behind a DOM element during a\n * drag. Keyed by object identity, so it survives every operation in this file and\n * is *not* preserved by {@link cloneDockLayout}.\n */\nexport function dockPaneKey(pane: XuiDockPane): string {\n let key = paneKeys.get(pane);\n\n if (!key) {\n key = `pane-${++nextPaneKey}`;\n paneKeys.set(pane, key);\n }\n\n return key;\n}\n\n/**\n * A structural copy of the layout, safe to keep as an undo snapshot.\n *\n * A round-trip through JSON, which the layout's own contract allows: every node\n * is plain data. The copy is a *different* set of objects, so its panes get fresh\n * {@link dockPaneKey}s and restoring it replaces the rendered panes rather than\n * moving them.\n */\nexport function cloneDockLayout(layout: XuiDockManagerLayout): XuiDockManagerLayout {\n return JSON.parse(JSON.stringify(layout)) as XuiDockManagerLayout;\n}\n\n/** The child panes of `pane`, or an empty array for a leaf. */\nexport function dockChildren(pane: XuiDockPane): readonly XuiDockPane[] {\n if (isParentPane(pane)) {\n return pane.panes;\n }\n\n return isDocumentHost(pane) ? [pane.rootPane] : [];\n}\n\n/** Every root of the layout: the docked tree, then each floating window. */\nexport function dockRoots(layout: XuiDockManagerLayout): XuiDockPane[] {\n return [layout.rootPane, ...(layout.floatingPanes ?? [])];\n}\n\n/**\n * Depth-first walk over every pane in the layout, floating windows included.\n * Returning `false` from `visitor` skips that pane's subtree.\n */\nexport function visitDockPanes(layout: XuiDockManagerLayout, visitor: (pane: XuiDockPane) => boolean | void): void {\n const walk = (pane: XuiDockPane): void => {\n if (visitor(pane) === false) {\n return;\n }\n\n for (const child of [...dockChildren(pane)]) {\n walk(child);\n }\n };\n\n for (const root of dockRoots(layout)) {\n walk(root);\n }\n}\n\n/** The pane whose `panes` array holds `pane`, or `null` for a root. */\nexport function findDockParent(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockParentPane | null {\n let found: XuiDockParentPane | null = null;\n\n visitDockPanes(layout, candidate => {\n if (found) {\n return false;\n }\n\n if (isParentPane(candidate) && candidate.panes.includes(pane as XuiDockContentPane)) {\n found = candidate;\n return false;\n }\n\n return undefined;\n });\n\n return found;\n}\n\n/** `pane`'s ancestors, nearest first. */\nexport function dockAncestors(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockPane[] {\n const path: XuiDockPane[] = [];\n\n const walk = (current: XuiDockPane, trail: XuiDockPane[]): boolean => {\n if (current === pane) {\n path.push(...trail);\n return true;\n }\n\n for (const child of dockChildren(current)) {\n if (walk(child, [current, ...trail])) {\n return true;\n }\n }\n\n return false;\n };\n\n for (const root of dockRoots(layout)) {\n if (walk(root, [])) {\n break;\n }\n }\n\n return path;\n}\n\n/** The layout's document host, if it has one. */\nexport function findDocumentHost(layout: XuiDockManagerLayout): XuiDockDocumentHost | null {\n let host: XuiDockDocumentHost | null = null;\n\n visitDockPanes(layout, pane => {\n if (host) {\n return false;\n }\n\n if (isDocumentHost(pane)) {\n host = pane;\n return false;\n }\n\n return undefined;\n });\n\n return host;\n}\n\n/** Whether `pane` sits inside the document host. */\nexport function isInDocumentHost(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return dockAncestors(layout, pane).some(isDocumentHost);\n}\n\n/** Whether `pane` is the root of a floating window. */\nexport function isFloatingRoot(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return (layout.floatingPanes ?? []).includes(pane as XuiDockSplitPane);\n}\n\n/** Whether `pane` is a root that must not be collapsed away. */\nexport function isDockRoot(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n return pane === layout.rootPane || isFloatingRoot(layout, pane);\n}\n\n/** Every content pane in the layout, in tree order. */\nexport function collectContentPanes(layout: XuiDockManagerLayout): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n\n visitDockPanes(layout, pane => {\n if (isContentPane(pane)) {\n out.push(pane);\n }\n });\n\n return out;\n}\n\n/** The content pane that is currently maximized, if any. */\nexport function findMaximizedPane(layout: XuiDockManagerLayout): XuiDockContentPane | null {\n return collectContentPanes(layout).find(pane => pane.isMaximized) ?? null;\n}\n\n/**\n * Whether the pane takes up space in the docked layout. An unpinned content pane\n * does not, and neither does a split pane or tab group whose whole subtree is\n * unpinned — otherwise collapsing a sidebar would leave a gap behind it.\n */\nexport function isDockPaneVisible(pane: XuiDockPane): boolean {\n if (isContentPane(pane)) {\n return pane.isPinned !== false;\n }\n\n if (isDocumentHost(pane)) {\n return true;\n }\n\n return pane.panes.some(isDockPaneVisible);\n}\n\n/** The children of `pane` that take up space, in order. */\nexport function visibleDockChildren(pane: XuiDockPane): XuiDockPane[] {\n return [...dockChildren(pane)].filter(isDockPaneVisible);\n}\n\n/** The tab a tab group shows: its `selectedIndex`, or the first pinned tab. */\nexport function selectedTabPane(group: XuiDockTabGroupPane): XuiDockContentPane | null {\n const visible = group.panes.filter(isDockPaneVisible);\n\n if (!visible.length) {\n return null;\n }\n\n const selected = group.panes[group.selectedIndex ?? 0];\n\n return selected && visible.includes(selected) ? selected : visible[0];\n}\n\n/**\n * Which edge an unpinned pane collapses to when `unpinnedLocation` is unset.\n *\n * Follows the pane's own position in the tree — a pane in the first branch of a\n * horizontal split goes to the inline start, one in the last branch to the inline\n * end — so a sidebar collapses to the side it was already on.\n */\nexport function defaultUnpinnedLocation(layout: XuiDockManagerLayout, pane: XuiDockPane): XuiDockUnpinnedLocation {\n let child = pane;\n\n for (const ancestor of dockAncestors(layout, pane)) {\n if (isSplitPane(ancestor) && ancestor.panes.length > 1) {\n const first = ancestor.panes.indexOf(child as XuiDockContentPane) === 0;\n\n if (ancestor.orientation === 'horizontal') {\n return first ? 'start' : 'end';\n }\n\n return first ? 'top' : 'bottom';\n }\n\n child = ancestor;\n }\n\n return 'end';\n}\n\n/** The unpinned content panes, grouped by the edge their tabs sit on. */\nexport function unpinnedDockPanes(layout: XuiDockManagerLayout): Record<XuiDockUnpinnedLocation, XuiDockContentPane[]> {\n const groups: Record<XuiDockUnpinnedLocation, XuiDockContentPane[]> = { start: [], end: [], top: [], bottom: [] };\n\n for (const pane of collectContentPanes(layout)) {\n if (pane.isPinned === false) {\n groups[pane.unpinnedLocation ?? defaultUnpinnedLocation(layout, pane)].push(pane);\n }\n }\n\n return groups;\n}\n\n/**\n * Tidy the tree after a mutation: drop empty parents, unwrap split panes down to\n * a single child, merge nested splits that run along the same axis, and clamp\n * every tab group's selected index.\n *\n * Roots survive all of this — `layout.rootPane`, a floating window's root and a\n * document host's root pane are structural and stay put even when empty. A root\n * left with a single split pane beneath it absorbs that child rather than being\n * replaced by it.\n */\nexport function normalizeDockLayout(layout: XuiDockManagerLayout): void {\n const root = normalizePane(layout.rootPane, true);\n layout.rootPane = (root ?? emptySplitPane()) as XuiDockSplitPane | XuiDockDocumentHost;\n\n const floating: XuiDockSplitPane[] = [];\n\n for (const pane of layout.floatingPanes ?? []) {\n const normalized = normalizePane(pane, true);\n\n // A floating window whose last pane was closed or docked away is gone.\n if (normalized && isSplitPane(normalized) && normalized.panes.length) {\n floating.push(normalized);\n }\n }\n\n layout.floatingPanes = floating;\n}\n\nfunction emptySplitPane(): XuiDockSplitPane {\n return { type: 'splitPane', orientation: 'horizontal', panes: [], allowEmpty: true };\n}\n\nfunction normalizePane(pane: XuiDockPane, isRoot: boolean): XuiDockPane | null {\n if (isContentPane(pane)) {\n return pane;\n }\n\n if (isDocumentHost(pane)) {\n const inner = normalizePane(pane.rootPane, true);\n pane.rootPane = inner && isSplitPane(inner) ? inner : emptySplitPane();\n // The document host is structural: an empty editor area is a valid state.\n return pane;\n }\n\n if (isTabGroupPane(pane)) {\n if (!pane.panes.length && !pane.allowEmpty && !isRoot) {\n return null;\n }\n\n pane.selectedIndex = Math.min(Math.max(pane.selectedIndex ?? 0, 0), Math.max(0, pane.panes.length - 1));\n return pane;\n }\n\n const children: XuiDockPane[] = [];\n\n for (const child of pane.panes) {\n const normalized = normalizePane(child, false);\n\n if (!normalized) {\n continue;\n }\n\n // A split inside a split along the same axis is the same layout with an extra\n // level of nesting; splice it away so repeated docking cannot grow the tree\n // without bound.\n if (isSplitPane(normalized) && normalized.orientation === pane.orientation && normalized.panes.length > 1) {\n children.push(...redistribute(normalized.panes, normalized.size ?? 1));\n continue;\n }\n\n children.push(normalized);\n }\n\n pane.panes = children;\n\n if (!children.length) {\n return pane.allowEmpty || isRoot ? pane : null;\n }\n\n if (children.length === 1) {\n const only = children[0];\n\n if (!isRoot) {\n // The wrapper's share of the grandparent becomes the child's.\n only.size = pane.size ?? only.size;\n return only;\n }\n\n // A root cannot be replaced — floating geometry and the caller's reference\n // hang off it — so it absorbs its lone child's axis and children instead.\n // Without this, every drop onto the root would leave another dead level.\n if (isSplitPane(only)) {\n pane.orientation = only.orientation;\n pane.panes = only.panes;\n }\n }\n\n return pane;\n}\n\n/** Rescale `panes` so their weights sum to `total`, keeping their proportions. */\nfunction redistribute(panes: XuiDockPane[], total: number): XuiDockPane[] {\n const sum = panes.reduce((acc, pane) => acc + (pane.size ?? 1), 0) || panes.length;\n\n for (const pane of panes) {\n pane.size = ((pane.size ?? 1) / sum) * total;\n }\n\n return panes;\n}\n\n/**\n * Detach `pane` from wherever it sits — a parent's `panes`, or the floating\n * window list — and tidy up behind it. Returns `false` if it was not in the\n * layout at all.\n */\nexport function removeDockPane(layout: XuiDockManagerLayout, pane: XuiDockPane): boolean {\n const floating = layout.floatingPanes ?? [];\n const floatingIndex = floating.indexOf(pane as XuiDockSplitPane);\n\n if (floatingIndex >= 0) {\n floating.splice(floatingIndex, 1);\n normalizeDockLayout(layout);\n return true;\n }\n\n const parent = findDockParent(layout, pane);\n\n if (!parent) {\n return false;\n }\n\n parent.panes.splice(parent.panes.indexOf(pane as XuiDockContentPane), 1);\n normalizeDockLayout(layout);\n return true;\n}\n\n/** The axis a docking position splits along. */\nfunction axisOf(position: Exclude<XuiDockPosition, 'center'>): XuiDockSplitOrientation {\n return position === 'start' || position === 'end' ? 'horizontal' : 'vertical';\n}\n\n/** Whether the dragged pane goes before the target along that axis. */\nfunction isBefore(position: Exclude<XuiDockPosition, 'center'>): boolean {\n return position === 'start' || position === 'top';\n}\n\n/**\n * Whether `pane` may be dropped onto `target`.\n *\n * A `documentOnly` pane is confined to the document host; anything else may dock\n * anywhere. A pane can never be dropped onto itself or into its own subtree.\n */\nexport function canDockInto(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (pane === target) {\n return false;\n }\n\n if (dockAncestors(layout, target).includes(pane)) {\n return false;\n }\n\n if (isContentPane(pane) && pane.allowDocking === false) {\n return false;\n }\n\n if (!documentOnlyPanes(pane)) {\n return true;\n }\n\n // Docking against the document host's outer edges would put the document\n // *beside* the editor area rather than in it, so only `center` qualifies.\n return isDocumentHost(target) ? position === 'center' : isInDocumentHost(layout, target);\n}\n\n/** Whether every content pane in `pane`'s subtree is `documentOnly`. */\nfunction documentOnlyPanes(pane: XuiDockPane): boolean {\n const contents: XuiDockContentPane[] = [];\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n contents.push(current);\n return;\n }\n\n for (const child of dockChildren(current)) {\n walk(child);\n }\n };\n\n walk(pane);\n\n return contents.length > 0 && contents.every(content => content.documentOnly);\n}\n\n/**\n * Attach `pane` to the layout next to `target`.\n *\n * `center` tabs the pane together with the target — turning a lone content pane\n * into a two-tab group — while the four edge positions split the space. An edge\n * drop reuses the target's parent when it already runs along the right axis, so\n * dropping three panes to the right of each other yields one three-way split\n * rather than three nested ones.\n */\nexport function insertDockPane(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (position === 'center') {\n return insertIntoCenter(layout, pane, target);\n }\n\n const axis = axisOf(position);\n const before = isBefore(position);\n const parent = findDockParent(layout, target);\n\n if (parent && isSplitPane(parent) && parent.orientation === axis) {\n const index = parent.panes.indexOf(target as XuiDockContentPane);\n // Split the target's own share rather than adding weight, so the panes either\n // side of it keep the proportions they had.\n const share = target.size ?? 1;\n target.size = share / 2;\n pane.size = share / 2;\n parent.panes.splice(before ? index : index + 1, 0, pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n // A root has no parent to insert into, so it grows a level instead: it keeps\n // its own identity (and any floating geometry) and adopts the new axis.\n if (!parent && isSplitPane(target) && isDockRoot(layout, target)) {\n if (target.orientation !== axis && target.panes.length > 1) {\n const inner: XuiDockSplitPane = { type: 'splitPane', orientation: target.orientation, panes: target.panes };\n target.panes = [inner];\n }\n\n target.orientation = axis;\n target.panes.splice(before ? 0 : target.panes.length, 0, pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n const wrapper: XuiDockSplitPane = {\n type: 'splitPane',\n orientation: axis,\n size: target.size ?? 1,\n panes: before ? [pane, target] : [target, pane]\n };\n\n target.size = 1;\n pane.size = 1;\n\n return replacePane(layout, target, wrapper);\n}\n\nfunction insertIntoCenter(layout: XuiDockManagerLayout, pane: XuiDockPane, target: XuiDockPane): boolean {\n const incoming = isContentPane(pane) ? [pane] : tabbableContentPanes(pane);\n\n if (isDocumentHost(target)) {\n return insertIntoCenter(layout, pane, target.rootPane);\n }\n\n if (isTabGroupPane(target) && incoming.length) {\n target.panes.push(...incoming);\n target.selectedIndex = target.panes.length - 1;\n normalizeDockLayout(layout);\n return true;\n }\n\n if (isSplitPane(target)) {\n // Nothing to tab with — an empty split pane (a bare document host) simply\n // adopts the pane.\n target.panes.push(pane as XuiDockContentPane);\n normalizeDockLayout(layout);\n return true;\n }\n\n if (!isContentPane(target) || !incoming.length) {\n return false;\n }\n\n const group: XuiDockTabGroupPane = {\n type: 'tabGroupPane',\n size: target.size ?? 1,\n panes: [target, ...incoming],\n // Select the pane that was just dropped, the way a dragged browser tab lands\n // in front.\n selectedIndex: 1\n };\n\n target.size = 1;\n\n return replacePane(layout, target, group);\n}\n\n/** The content panes of a subtree, flattened, for merging into a tab group. */\nfunction tabbableContentPanes(pane: XuiDockPane): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n out.push(current);\n return;\n }\n\n for (const child of dockChildren(current)) {\n walk(child);\n }\n };\n\n walk(pane);\n\n return out;\n}\n\n/** Swap `target` for `replacement` wherever it sits, root positions included. */\nfunction replacePane(layout: XuiDockManagerLayout, target: XuiDockPane, replacement: XuiDockPane): boolean {\n if (target === layout.rootPane) {\n layout.rootPane = replacement as XuiDockSplitPane | XuiDockDocumentHost;\n normalizeDockLayout(layout);\n return true;\n }\n\n const floating = layout.floatingPanes ?? [];\n const floatingIndex = floating.indexOf(target as XuiDockSplitPane);\n\n if (floatingIndex >= 0) {\n floating[floatingIndex] = replacement as XuiDockSplitPane;\n normalizeDockLayout(layout);\n return true;\n }\n\n const parent = findDockParent(layout, target);\n\n if (parent) {\n parent.panes[parent.panes.indexOf(target as XuiDockContentPane)] = replacement as XuiDockContentPane;\n normalizeDockLayout(layout);\n return true;\n }\n\n const host = dockAncestors(layout, target).find(isDocumentHost);\n\n if (host && isSplitPane(replacement)) {\n host.rootPane = replacement;\n normalizeDockLayout(layout);\n return true;\n }\n\n return false;\n}\n\n/** Move `pane` out of the layout and into a floating window of its own. */\nexport function floatDockPane(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n location: XuiDockPoint,\n size?: { width: number; height: number }\n): XuiDockSplitPane | null {\n if (isContentPane(pane) && pane.allowFloating === false) {\n return null;\n }\n\n // Already floating: this is a move, not a detach.\n if (isSplitPane(pane) && isFloatingRoot(layout, pane)) {\n pane.floatingLocation = location;\n return pane;\n }\n\n if (!removeDockPane(layout, pane)) {\n return null;\n }\n\n pane.size = 1;\n\n const window: XuiDockSplitPane = {\n type: 'splitPane',\n orientation: 'horizontal',\n panes: [pane],\n floatingLocation: location,\n floatingWidth: size?.width ?? 400,\n floatingHeight: size?.height ?? 300,\n floatingResizable: true\n };\n\n layout.floatingPanes = [...(layout.floatingPanes ?? []), window];\n normalizeDockLayout(layout);\n\n return window;\n}\n\n/** Move `pane` from wherever it is to `position` relative to `target`. */\nexport function dockPaneAt(\n layout: XuiDockManagerLayout,\n pane: XuiDockPane,\n target: XuiDockPane,\n position: XuiDockPosition\n): boolean {\n if (!canDockInto(layout, pane, target, position)) {\n return false;\n }\n\n removeDockPane(layout, pane);\n\n // Geometry only means something while the pane is a floating window; leaving it\n // behind would resurrect the old size the next time it is floated.\n if (isSplitPane(pane)) {\n delete pane.floatingLocation;\n delete pane.floatingWidth;\n delete pane.floatingHeight;\n delete pane.floatingResizable;\n }\n\n // `removeDockPane` normalises, which can unwrap the target's parent — but never\n // the target itself, so it is still a valid insertion point.\n return insertDockPane(layout, pane, target, position);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n type EmbeddedViewRef\n} from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport {\n matCloseFullscreenRound,\n matCloseRound,\n matDockRound,\n matOpenInFullRound,\n matOpenInNewRound,\n matPushPinRound\n} from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { arrowDirectionOnAxis, injectXDirection } from '@xui/core/a11y';\nimport { injectXPointerDrag, type XPointerDragStop } from '@xui/core/interactions';\nimport { XuiIcon } from '@xui/icon';\nimport type { ClassValue } from 'clsx';\nimport {\n XUI_DOCK_CONTENT_MOUNTER,\n XuiDockContent,\n XuiDockContentOutlet,\n type XuiDockContentMounter\n} from './dock-content';\nimport {\n isContentPane,\n isDocumentHost,\n isSplitPane,\n isTabGroupPane,\n type XuiDockContentPane,\n type XuiDockManagerLayout,\n type XuiDockPane,\n type XuiDockPaneStateEvent,\n type XuiDockPoint,\n type XuiDockPosition,\n type XuiDockSplitPane,\n type XuiDockTabGroupPane,\n type XuiDockUnpinnedLocation\n} from './dock-manager.types';\nimport {\n canDockInto,\n collectContentPanes,\n defaultUnpinnedLocation,\n dockPaneAt,\n dockPaneKey,\n findMaximizedPane,\n floatDockPane,\n normalizeDockLayout,\n removeDockPane,\n selectedTabPane,\n unpinnedDockPanes,\n visibleDockChildren\n} from './dock-manager.utils';\n\n/** Thickness of the edge strips that hold unpinned panes' tabs, in pixels. */\nconst STRIP_SIZE = 32;\n\n/** How close to the dock manager's own edge a drop docks against the whole layout. */\nconst OUTER_EDGE = 28;\n\n/** A pane never resizes below this, so its header always stays grabbable. */\nconst MIN_PANE_SIZE = 48;\n\n/** Where a floating window sits when its layout gives no `floatingLocation`. */\nconst FLOATING_ORIGIN: XuiDockPoint = { x: 40, y: 40 };\n\n/** Pointer travel before a press on a header turns into a drag. */\nconst DRAG_THRESHOLD = 4;\n\n/** The centre of a pane is a \"tab it here\" target; outside it, the nearest edge wins. */\nconst CENTRE_ZONE = 0.3;\n\n/** Size of one docking indicator square, and the gap between them. */\nconst INDICATOR_SIZE = 30;\nconst INDICATOR_GAP = 4;\n\n/** How far the outer ring of indicators sits from the dock manager's frame. */\nconst INDICATOR_INSET = 8;\n\n/** Below this the joystick would not fit inside the pane, so it is not offered. */\nconst INDICATOR_MIN_PANE = 96;\n\ninterface DropTarget {\n pane: XuiDockPane;\n position: XuiDockPosition;\n}\n\n/**\n * One square of the docking joystick, positioned in coordinates relative to the\n * dock manager. `side` is the *visual* half it fills in, which is the mirror of\n * `position` on the inline axis in RTL.\n */\ninterface DockIndicator extends DropTarget {\n key: string;\n side: 'left' | 'right' | 'top' | 'bottom' | 'center';\n left: number;\n top: number;\n active: boolean;\n}\n\ninterface DragState {\n /** The pane being dragged — a content pane, or a floating window's root. */\n pane: XuiDockPane;\n /** Set when the gesture started on a floating window's title bar. */\n window: XuiDockSplitPane | null;\n x: number;\n y: number;\n}\n\ninterface Rect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/**\n * An IDE-style docking layout: resizable split panes, tab groups, a document\n * host, collapsible edge panels and floating windows, all driven by one\n * serialisable {@link XuiDockManagerLayout} tree.\n *\n * ```html\n * <xui-dock-manager [(layout)]=\"layout\" class=\"h-[32rem]\">\n * <ng-template xuiDockContent=\"explorer\">…</ng-template>\n * <ng-template xuiDockContent=\"editor\">…</ng-template>\n * </xui-dock-manager>\n * ```\n *\n * The layout shape follows Ignite UI's `IgcDockManagerLayout`, so existing\n * layouts port over by dropping the `Igc` prefix and using string literals in\n * place of its enums.\n *\n * Panes carry no content of their own: each one names a `contentId`, and the\n * matching `[xuiDockContent]` template supplies the body. Those bodies are\n * instantiated once and then *moved* as the layout changes, so a pane keeps its\n * scroll position and component state when it is dragged to another dock, tabbed,\n * floated or collapsed.\n *\n * `layout` is two-way bindable and the dock manager edits the tree **in place**\n * before emitting, which is what keeps pane identity stable across a drag. Bind a\n * signal to it and snapshot with `cloneDockLayout()` if you need an undo buffer.\n *\n * Dragging is a pointer gesture. Picking up a pane raises Visual Studio's docking\n * targets: a five-way joystick over whichever pane is under the pointer — four\n * arms to split it, the centre to tab with it — and an outer ring at the dock\n * manager's edges to dock against the whole layout. Only the targets the dragged\n * pane is allowed to take are drawn, and the one that would be used is\n * highlighted while an outline previews the space it would claim.\n *\n * Off the targets, the two gestures differ. A header or tab drag has no other\n * purpose, so the whole pane stays live and the nearest edge wins; dropping\n * outside the layout floats the pane. Dragging a floating window's title bar is\n * mostly about *moving* the window, so it docks from the targets alone.\n *\n * Every other operation — close, pin, maximize, float, tab selection, splitter\n * resize — is reachable from the keyboard, and the public methods (`closePane`,\n * `unpinPane`, `dockPane`, …) drive the same paths for code. Docking itself has no\n * keyboard equivalent yet.\n */\n@Component({\n selector: 'xui-dock-manager',\n imports: [NgTemplateOutlet, NgIcon, XuiIcon, XuiDockContentOutlet],\n viewProviders: [\n provideIcons({\n matCloseRound,\n matDockRound,\n matPushPinRound,\n matOpenInFullRound,\n matCloseFullscreenRound,\n matOpenInNewRound\n })\n ],\n providers: [{ provide: XUI_DOCK_CONTENT_MOUNTER, useExisting: forwardRef(() => XuiDockManager) }],\n // eslint-disable-next-line local/no-hand-z-index -- maximized pane, drop rect and drag ghost layer on the dock’s internal z scale, not the overlay container\n template: `\n <!-- ─── one content pane: header chrome plus the body outlet ─────────── -->\n <ng-template #contentTpl let-pane let-hideHeader=\"hideHeader\">\n <div\n [class]=\"frameClass(pane)\"\n [attr.data-dock-key]=\"key(pane)\"\n (pointerdown)=\"activate(pane)\"\n (focusin)=\"activate(pane)\"\n >\n @if (!hideHeader) {\n <div\n [class]=\"headerClass(pane)\"\n (pointerdown)=\"startPaneDrag(pane, null, $event)\"\n (dblclick)=\"toggleMaximized(pane)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ pane.header }}</span>\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n }\n\n <div class=\"min-h-0 min-w-0 flex-1 overflow-auto\" [xuiDockContentOutlet]=\"pane.contentId\"></div>\n </div>\n </ng-template>\n\n <!-- ─── the pin / maximize / close cluster, shared by headers and tabs ── -->\n <ng-template #paneActionsTpl let-pane>\n <div class=\"flex shrink-0 items-center\">\n @if (pane.allowPinning !== false && !pane.documentOnly) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"(pane.isPinned === false ? 'Pin ' : 'Collapse ') + (pane.header || pane.contentId)\"\n (click)=\"togglePinned(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matPushPinRound\" [class]=\"pane.isPinned === false ? 'text-primary' : ''\" />\n </button>\n }\n @if (pane.allowFloating !== false && !pane.documentOnly && !isFloating(pane)) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"'Float ' + (pane.header || pane.contentId)\"\n (click)=\"floatPane(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matOpenInNewRound\" />\n </button>\n }\n @if (pane.allowMaximize !== false) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"(pane.isMaximized ? 'Restore ' : 'Maximize ') + (pane.header || pane.contentId)\"\n (click)=\"toggleMaximized(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" [name]=\"pane.isMaximized ? 'matCloseFullscreenRound' : 'matOpenInFullRound'\" />\n </button>\n }\n @if (pane.allowClose !== false) {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n [attr.aria-label]=\"'Close ' + (pane.header || pane.contentId)\"\n (click)=\"closePane(pane); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matCloseRound\" />\n </button>\n }\n </div>\n </ng-template>\n\n <!-- ─── a tab group: one strip, one visible body ─────────────────────── -->\n <ng-template #tabGroupTpl let-pane>\n <div [class]=\"frameClass(pane)\" [attr.data-dock-key]=\"key(pane)\">\n <div [class]=\"tabStripClass()\" role=\"tablist\">\n @for (tab of pinnedTabs(pane); track key(tab)) {\n <button\n type=\"button\"\n role=\"tab\"\n [class]=\"tabClass(pane, tab)\"\n [attr.aria-selected]=\"tab === selectedTab(pane)\"\n [tabindex]=\"tab === selectedTab(pane) ? 0 : -1\"\n (click)=\"selectPane(tab)\"\n (pointerdown)=\"startPaneDrag(tab, null, $event)\"\n (dblclick)=\"toggleMaximized(tab)\"\n (keydown)=\"onTabKeydown(pane, $event)\"\n >\n <span class=\"min-w-0 truncate\">{{ tab.header }}</span>\n @if (tab.allowClose !== false) {\n <!-- A nested <button> is invalid markup, so this affordance is\n pointer-only and hidden from assistive technology; the\n action cluster on the right carries the real close button. -->\n <span\n aria-hidden=\"true\"\n [class]=\"tabCloseClass()\"\n (click)=\"closePane(tab); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"12px\" name=\"matCloseRound\" />\n </span>\n }\n </button>\n }\n\n @if (selectedTab(pane); as tab) {\n <div class=\"ms-auto flex items-center ps-1\">\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: tab }\" />\n </div>\n }\n </div>\n\n @if (selectedTab(pane); as tab) {\n <div\n role=\"tabpanel\"\n class=\"min-h-0 min-w-0 flex-1 overflow-auto\"\n [xuiDockContentOutlet]=\"tab.contentId\"\n (pointerdown)=\"activate(tab)\"\n (focusin)=\"activate(tab)\"\n ></div>\n }\n </div>\n </ng-template>\n\n <!-- ─── a split pane: children along one axis, gutters in between ────── -->\n <ng-template #splitTpl let-pane>\n <div [class]=\"splitClass(pane)\">\n @for (child of childrenOf(pane); track key(child); let i = $index, last = $last) {\n <div class=\"relative flex min-h-0 min-w-0\" [style.flex]=\"flexOf(child)\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: child }\" />\n </div>\n\n @if (!last) {\n <!-- Drag or arrow-key the gutter to trade space between the panes\n either side of it. -->\n <div\n role=\"separator\"\n tabindex=\"0\"\n [class]=\"gutterClass(pane)\"\n [attr.aria-orientation]=\"pane.orientation === 'vertical' ? 'horizontal' : 'vertical'\"\n [attr.aria-label]=\"'Resize ' + headerOf(child)\"\n (pointerdown)=\"startSplitterDrag(pane, i, $event)\"\n (keydown)=\"onSplitterKeydown(pane, i, $event)\"\n >\n <span [class]=\"gutterHandleClass(pane)\"></span>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- ─── the document host: the only home for documentOnly panes ─────── -->\n <ng-template #documentHostTpl let-pane>\n <div class=\"bg-surface-sunken flex min-h-0 min-w-0 flex-1\" [attr.data-dock-key]=\"key(pane)\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane.rootPane }\" />\n </div>\n </ng-template>\n\n <ng-template #paneTpl let-pane>\n @switch (pane.type) {\n @case ('splitPane') {\n <ng-container [ngTemplateOutlet]=\"splitTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @case ('tabGroupPane') {\n <ng-container [ngTemplateOutlet]=\"tabGroupTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @case ('documentHost') {\n <ng-container [ngTemplateOutlet]=\"documentHostTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n @default {\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n }\n }\n </ng-template>\n\n <!-- ─── the dock manager itself ─────────────────────────────────────── -->\n @if (maximized(); as pane) {\n <div class=\"absolute inset-0 z-30 flex\">\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n } @else {\n @if (unpinned().top.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n }\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n @if (unpinned().start.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'start' }\" />\n }\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: layout().rootPane }\" />\n </div>\n\n @if (unpinned().end.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'end' }\" />\n }\n </div>\n\n @if (unpinned().bottom.length) {\n <ng-container [ngTemplateOutlet]=\"stripTpl\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n }\n\n <!-- The fly-out an unpinned pane opens over the layout. -->\n @if (flyout(); as pane) {\n <div data-dock-flyout [class]=\"flyoutClass()\" [style]=\"flyoutStyle(pane)\">\n <ng-container [ngTemplateOutlet]=\"contentTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n </div>\n }\n\n @for (window of floatingPanes(); track key(window)) {\n <div\n [attr.data-dock-window]=\"key(window)\"\n [class]=\"floatingClass()\"\n [style]=\"floatingStyle(window)\"\n (pointerdown)=\"bringToFront(window)\"\n >\n <div\n [class]=\"titleBarClass()\"\n (pointerdown)=\"startPaneDrag(floatingContent(window), window, $event)\"\n (dblclick)=\"dockBack(window)\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ floatingTitle(window) }}</span>\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n aria-label=\"Dock window\"\n (click)=\"dockBack(window); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matDockRound\" />\n </button>\n\n <!-- A one-pane window shows that pane's own actions; the header they\n would normally live in is suppressed below. -->\n @if (singlePane(window); as pane) {\n <ng-container [ngTemplateOutlet]=\"paneActionsTpl\" [ngTemplateOutletContext]=\"{ $implicit: pane }\" />\n } @else {\n <button\n type=\"button\"\n [class]=\"actionClass()\"\n aria-label=\"Close window\"\n (click)=\"closeWindow(window); $event.stopPropagation()\"\n (pointerdown)=\"$event.stopPropagation()\"\n >\n <ng-icon xui size=\"14px\" name=\"matCloseRound\" />\n </button>\n }\n </div>\n\n <div class=\"flex min-h-0 min-w-0 flex-1\">\n @if (singlePane(window); as pane) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl\"\n [ngTemplateOutletContext]=\"{ $implicit: pane, hideHeader: true }\"\n />\n } @else {\n <ng-container [ngTemplateOutlet]=\"paneTpl\" [ngTemplateOutletContext]=\"{ $implicit: window }\" />\n }\n </div>\n\n @if (window.floatingResizable !== false) {\n @for (handle of RESIZE_HANDLES; track handle.id) {\n <div\n [class]=\"handle.class\"\n [attr.aria-hidden]=\"true\"\n (pointerdown)=\"startFloatingResize(window, handle.id, $event)\"\n ></div>\n }\n }\n </div>\n }\n }\n\n <!-- Where a drop would land. -->\n @if (dropRect(); as rect) {\n <div\n class=\"border-primary bg-primary/20 pointer-events-none absolute z-50 rounded-sm border-2\"\n [style.left.px]=\"rect.left\"\n [style.top.px]=\"rect.top\"\n [style.width.px]=\"rect.width\"\n [style.height.px]=\"rect.height\"\n ></div>\n }\n\n <!-- ─── the docking joystick and the outer ring ─────────────────────── -->\n @for (indicator of dockIndicators(); track indicator.key) {\n <div\n aria-hidden=\"true\"\n [class]=\"indicatorClass(indicator)\"\n [style.left.px]=\"indicator.left\"\n [style.top.px]=\"indicator.top\"\n [style.width.px]=\"INDICATOR_SIZE\"\n [style.height.px]=\"INDICATOR_SIZE\"\n >\n <span [class]=\"indicatorFillClass(indicator)\"></span>\n </div>\n }\n\n @if (dragGhost(); as ghost) {\n <div\n class=\"bg-surface-overlay border-border text-foreground shadow-overlay pointer-events-none fixed z-60 rounded-md border px-2 py-1 text-xs\"\n [style.left.px]=\"ghost.x + 12\"\n [style.top.px]=\"ghost.y + 12\"\n >\n {{ ghost.label }}\n </div>\n }\n\n <!-- ─── an edge strip of collapsed panes ────────────────────────────── -->\n <ng-template #stripTpl let-location>\n <div data-dock-strip [class]=\"stripClass(location)\">\n @for (pane of unpinnedAt(location); track key(pane)) {\n <button\n type=\"button\"\n [class]=\"stripTabClass(location, pane)\"\n [attr.aria-expanded]=\"pane === flyout()\"\n (click)=\"toggleFlyout(pane)\"\n >\n {{ pane.header || pane.contentId }}\n </button>\n }\n </div>\n </ng-template>\n `,\n host: {\n '[class]': 'computedClass()',\n '(keydown.escape)': 'onEscape()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiDockManager implements XuiDockContentMounter {\n private readonly el: HTMLElement = inject(ElementRef).nativeElement;\n private readonly document = this.el.ownerDocument;\n private readonly vcr = inject(ViewContainerRef);\n private readonly direction = injectXDirection();\n\n /** Detached parking space for the content views of panes that are not on screen. */\n private readonly holder = this.document.createElement('div');\n\n private readonly views = new Map<string, EmbeddedViewRef<unknown>>();\n\n // `descendants` so the templates may sit inside a wrapper element rather than\n // having to be immediate children.\n private readonly contents = contentChildren(XuiDockContent, { descendants: true });\n\n readonly class = input<ClassValue>('');\n\n /**\n * The layout tree. Two-way bindable, and edited **in place** — see the class\n * docs for why, and use `cloneDockLayout()` for snapshots.\n */\n readonly layout = model.required<XuiDockManagerLayout>();\n\n /** A pane was closed and removed from the layout. */\n readonly paneClose = output<XuiDockContentPane>();\n\n /** The pane the user last interacted with, or `null` once it is gone. */\n readonly activePaneChange = output<XuiDockContentPane | null>();\n\n readonly panePinnedChange = output<XuiDockPaneStateEvent>();\n readonly paneMaximizedChange = output<XuiDockPaneStateEvent>();\n readonly paneFloatingChange = output<XuiDockPaneStateEvent>();\n\n /** A pointer drag on a pane header or tab began. */\n readonly paneDragStart = output<XuiDockPane>();\n /** A pointer drag ended, whether or not it changed the layout. */\n readonly paneDragEnd = output<XuiDockPane>();\n\n /** The pane last interacted with. Drives the active header accent. */\n readonly activePane = signal<XuiDockContentPane | null>(null);\n\n private readonly drag = signal<DragState | null>(null);\n private readonly dropTarget = signal<DropTarget | null>(null);\n protected readonly dropRect = signal<Rect | null>(null);\n protected readonly dockIndicators = signal<DockIndicator[]>([]);\n\n /** The unpinned pane whose fly-out is open. */\n protected readonly flyout = signal<XuiDockContentPane | null>(null);\n\n protected readonly maximized = computed(() => findMaximizedPane(this.layout()));\n protected readonly unpinned = computed(() => unpinnedDockPanes(this.layout()));\n protected readonly floatingPanes = computed(() => this.layout().floatingPanes ?? []);\n\n protected readonly dragGhost = computed(() => {\n const state = this.drag();\n\n // A floating window drags itself, so it needs no ghost.\n return state && !state.window ? { x: state.x, y: state.y, label: this.headerOf(state.pane) } : null;\n });\n\n /** Exposed to the template so an indicator's box matches its hit area exactly. */\n protected readonly INDICATOR_SIZE = INDICATOR_SIZE;\n\n /** Exposed to the template; the ids double as the axis to resize along. */\n protected readonly RESIZE_HANDLES = [\n { id: 'top', class: 'absolute -top-1 inset-x-2 h-2 cursor-ns-resize' },\n { id: 'bottom', class: 'absolute -bottom-1 inset-x-2 h-2 cursor-ns-resize' },\n { id: 'left', class: 'absolute -left-1 inset-y-2 w-2 cursor-ew-resize' },\n { id: 'right', class: 'absolute -right-1 inset-y-2 w-2 cursor-ew-resize' },\n { id: 'top-left', class: 'absolute -top-1 -left-1 size-3 cursor-nwse-resize' },\n { id: 'top-right', class: 'absolute -top-1 -right-1 size-3 cursor-nesw-resize' },\n { id: 'bottom-left', class: 'absolute -bottom-1 -left-1 size-3 cursor-nesw-resize' },\n { id: 'bottom-right', class: 'absolute -right-1 -bottom-1 size-3 cursor-nwse-resize' }\n ] as const;\n\n constructor() {\n // Content views outlive the pane bodies they are mounted into, so they are\n // only destroyed once their pane leaves the layout for good.\n effect(() => {\n const live = new Set(collectContentPanes(this.layout()).map(pane => pane.contentId));\n\n for (const [contentId, view] of this.views) {\n if (!live.has(contentId)) {\n view.destroy();\n this.views.delete(contentId);\n }\n }\n\n const active = this.activePane();\n\n if (active && !live.has(active.contentId)) {\n this.activePane.set(null);\n this.activePaneChange.emit(null);\n }\n\n const flyout = this.flyout();\n\n if (flyout && (!live.has(flyout.contentId) || flyout.isPinned !== false)) {\n this.flyout.set(null);\n }\n });\n\n // A fly-out is a transient overlay: a pointer press anywhere that is not the\n // fly-out or an edge strip puts it away again.\n effect(onCleanup => {\n if (!this.flyout()) {\n return;\n }\n\n const onPointerDown = (event: Event): void => {\n if ((event.target as HTMLElement | null)?.closest('[data-dock-flyout], [data-dock-strip]')) {\n return;\n }\n\n this.flyout.set(null);\n };\n\n this.document.addEventListener('pointerdown', onPointerDown, true);\n onCleanup(() => this.document.removeEventListener('pointerdown', onPointerDown, true));\n });\n\n inject(DestroyRef).onDestroy(() => {\n for (const view of this.views.values()) {\n view.destroy();\n }\n\n this.views.clear();\n this.stopPointerTracking();\n });\n }\n\n // ─── content mounting ─────────────────────────────────────────────────────\n\n mountContent(contentId: string, host: HTMLElement): void {\n let view = this.views.get(contentId);\n\n if (!view) {\n const template = this.contents().find(content => content.contentId() === contentId)?.template;\n\n if (!template) {\n return;\n }\n\n view = this.vcr.createEmbeddedView(template);\n this.views.set(contentId, view);\n }\n\n for (const node of view.rootNodes as Node[]) {\n host.appendChild(node);\n }\n }\n\n releaseContent(contentId: string, host: HTMLElement): void {\n const view = this.views.get(contentId);\n\n if (!view) {\n return;\n }\n\n for (const node of view.rootNodes as Node[]) {\n if (node.parentNode === host) {\n this.holder.appendChild(node);\n }\n }\n }\n\n // ─── public API ───────────────────────────────────────────────────────────\n\n /** Remove `pane` from the layout. Respects `allowClose`. */\n closePane(pane: XuiDockContentPane): void {\n if (pane.allowClose === false) {\n return;\n }\n\n const layout = this.layout();\n\n if (removeDockPane(layout, pane)) {\n pane.isMaximized = false;\n this.commit();\n this.paneClose.emit(pane);\n }\n }\n\n /** Close every pane in a floating window. */\n closeWindow(window: XuiDockSplitPane): void {\n for (const pane of this.contentPanesOf(window)) {\n this.closePane(pane);\n }\n }\n\n /** Collapse `pane` to a tab on the nearest edge, keeping its place in the tree. */\n unpinPane(pane: XuiDockContentPane): void {\n if (pane.allowPinning === false || pane.documentOnly || pane.isPinned === false) {\n return;\n }\n\n // A pane inside a floating window has no edge to collapse to.\n if (this.isFloating(pane)) {\n this.dockBackPane(pane);\n }\n\n pane.isPinned = false;\n pane.isMaximized = false;\n this.flyout.set(null);\n this.commit();\n this.panePinnedChange.emit({ pane, value: false });\n }\n\n /** Restore `pane` to the position it was collapsed from. */\n pinPane(pane: XuiDockContentPane): void {\n if (pane.isPinned !== false) {\n return;\n }\n\n pane.isPinned = true;\n this.flyout.set(null);\n this.commit();\n this.panePinnedChange.emit({ pane, value: true });\n }\n\n togglePinned(pane: XuiDockContentPane): void {\n if (pane.isPinned === false) {\n this.pinPane(pane);\n } else {\n this.unpinPane(pane);\n }\n }\n\n /** Blow `pane` up to fill the whole dock manager, hiding everything else. */\n maximizePane(pane: XuiDockContentPane): void {\n if (pane.allowMaximize === false) {\n return;\n }\n\n for (const other of collectContentPanes(this.layout())) {\n other.isMaximized = other === pane;\n }\n\n this.commit();\n this.paneMaximizedChange.emit({ pane, value: true });\n }\n\n restorePane(pane: XuiDockContentPane): void {\n pane.isMaximized = false;\n this.commit();\n this.paneMaximizedChange.emit({ pane, value: false });\n }\n\n toggleMaximized(pane: XuiDockContentPane): void {\n if (pane.isMaximized) {\n this.restorePane(pane);\n } else {\n this.maximizePane(pane);\n }\n }\n\n /** Move `pane` into a floating window of its own. */\n floatPane(pane: XuiDockPane, location?: XuiDockPoint, size?: { width: number; height: number }): void {\n const rect = this.el.getBoundingClientRect();\n const fallback = { x: Math.round(rect.width / 4), y: Math.round(rect.height / 4) };\n\n if (isContentPane(pane)) {\n pane.isPinned = true;\n pane.isMaximized = false;\n }\n\n if (!floatDockPane(this.layout(), pane, location ?? fallback, size)) {\n return;\n }\n\n this.commit();\n\n for (const content of this.contentPanesOf(pane)) {\n this.paneFloatingChange.emit({ pane: content, value: true });\n }\n }\n\n /** Dock `pane` at `position` relative to `target`. */\n dockPane(pane: XuiDockPane, target: XuiDockPane, position: XuiDockPosition): boolean {\n const wasFloating = this.isFloating(pane);\n\n if (!dockPaneAt(this.layout(), pane, target, position)) {\n return false;\n }\n\n this.commit();\n\n if (wasFloating) {\n for (const content of this.contentPanesOf(pane)) {\n this.paneFloatingChange.emit({ pane: content, value: false });\n }\n }\n\n return true;\n }\n\n /** Make `pane` the active one, selecting its tab and opening its fly-out. */\n selectPane(pane: XuiDockContentPane): void {\n const group = this.tabGroupOf(pane);\n\n if (group) {\n group.selectedIndex = group.panes.indexOf(pane);\n this.commit();\n }\n\n if (pane.isPinned === false) {\n this.flyout.set(pane);\n }\n\n this.activate(pane);\n }\n\n // ─── template helpers ─────────────────────────────────────────────────────\n\n protected readonly key = dockPaneKey;\n\n protected childrenOf(pane: XuiDockPane): XuiDockPane[] {\n return visibleDockChildren(pane);\n }\n\n protected unpinnedAt(location: XuiDockUnpinnedLocation): XuiDockContentPane[] {\n return this.unpinned()[location];\n }\n\n protected pinnedTabs(group: XuiDockTabGroupPane): XuiDockContentPane[] {\n return group.panes.filter(pane => pane.isPinned !== false);\n }\n\n protected selectedTab(group: XuiDockTabGroupPane): XuiDockContentPane | null {\n return selectedTabPane(group);\n }\n\n protected flexOf(pane: XuiDockPane): string {\n return `${pane.size ?? 1} 1 0px`;\n }\n\n protected headerOf(pane: XuiDockPane): string {\n const contents = this.contentPanesOf(pane);\n\n return contents[0]?.header || contents[0]?.contentId || 'panes';\n }\n\n /** The pane a floating window's title bar drags: its lone pane, or the root. */\n protected floatingContent(window: XuiDockSplitPane): XuiDockPane {\n return this.singlePane(window) ?? window;\n }\n\n protected singlePane(window: XuiDockSplitPane): XuiDockContentPane | null {\n const only = window.panes.length === 1 ? window.panes[0] : null;\n\n return only && isContentPane(only) ? only : null;\n }\n\n protected floatingTitle(window: XuiDockSplitPane): string {\n const contents = this.contentPanesOf(window);\n\n if (contents.length === 1) {\n return contents[0].header || contents[0].contentId;\n }\n\n return `${contents.length} panes`;\n }\n\n protected isFloating(pane: XuiDockPane): boolean {\n const windows = this.layout().floatingPanes ?? [];\n\n return windows.some(window => window === pane || this.contentPanesOf(window).includes(pane as XuiDockContentPane));\n }\n\n protected toggleFlyout(pane: XuiDockContentPane): void {\n this.flyout.update(current => (current === pane ? null : pane));\n\n if (this.flyout()) {\n this.activate(pane);\n }\n }\n\n protected activate(pane: XuiDockContentPane): void {\n if (this.activePane() === pane) {\n return;\n }\n\n this.activePane.set(pane);\n this.activePaneChange.emit(pane);\n }\n\n protected onEscape(): void {\n if (this.drag()) {\n this.cancelDrag();\n return;\n }\n\n this.flyout.set(null);\n }\n\n /** Dock a whole floating window back into the layout root. */\n protected dockBack(window: XuiDockSplitPane): void {\n this.dockPane(window, this.layout().rootPane, 'end');\n }\n\n private dockBackPane(pane: XuiDockContentPane): void {\n this.dockPane(pane, this.layout().rootPane, 'end');\n }\n\n protected bringToFront(window: XuiDockSplitPane): void {\n const windows = this.layout().floatingPanes ?? [];\n\n if (windows[windows.length - 1] === window) {\n return;\n }\n\n this.layout().floatingPanes = [...windows.filter(other => other !== window), window];\n this.commit();\n }\n\n // ─── splitter resizing ────────────────────────────────────────────────────\n\n protected startSplitterDrag(parent: XuiDockSplitPane, gutter: number, event: PointerEvent): void {\n const gutterEl = event.currentTarget as HTMLElement;\n const beforeEl = gutterEl.previousElementSibling as HTMLElement | null;\n const afterEl = gutterEl.nextElementSibling as HTMLElement | null;\n\n if (!beforeEl || !afterEl) {\n return;\n }\n\n event.preventDefault();\n\n const vertical = parent.orientation === 'vertical';\n const children = this.childrenOf(parent);\n const before = children[gutter];\n const after = children[gutter + 1];\n const beforePx = vertical ? beforeEl.offsetHeight : beforeEl.offsetWidth;\n const afterPx = vertical ? afterEl.offsetHeight : afterEl.offsetWidth;\n const start = vertical ? event.clientY : event.clientX;\n\n // Dragging towards the inline end grows the leading pane; in RTL that is\n // leftwards, so the horizontal delta is negated.\n const sign = !vertical && this.direction() === 'rtl' ? -1 : 1;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const position = vertical ? moveEvent.clientY : moveEvent.clientX;\n const delta = this.clampSplitterDelta((position - start) * sign, beforePx, afterPx);\n\n this.resizeSiblings(before, after, beforePx + delta, beforePx + afterPx);\n };\n\n this.trackPointer(event, onMove);\n }\n\n protected onSplitterKeydown(parent: XuiDockSplitPane, gutter: number, event: KeyboardEvent): void {\n const vertical = parent.orientation === 'vertical';\n const arrow = arrowDirectionOnAxis(event.key, this.direction(), vertical ? 'vertical' : 'horizontal');\n const gutterEl = event.currentTarget as HTMLElement;\n const beforeEl = gutterEl.previousElementSibling as HTMLElement | null;\n const afterEl = gutterEl.nextElementSibling as HTMLElement | null;\n\n if (!arrow || !beforeEl || !afterEl) {\n return;\n }\n\n event.preventDefault();\n\n const children = this.childrenOf(parent);\n const beforePx = vertical ? beforeEl.offsetHeight : beforeEl.offsetWidth;\n const afterPx = vertical ? afterEl.offsetHeight : afterEl.offsetWidth;\n const step = (event.shiftKey ? 40 : 10) * (arrow === 'next' ? 1 : -1);\n const delta = this.clampSplitterDelta(step, beforePx, afterPx);\n\n this.resizeSiblings(children[gutter], children[gutter + 1], beforePx + delta, beforePx + afterPx);\n }\n\n private clampSplitterDelta(delta: number, beforePx: number, afterPx: number): number {\n return Math.max(MIN_PANE_SIZE - beforePx, Math.min(afterPx - MIN_PANE_SIZE, delta));\n }\n\n /** Re-weight two siblings so `before` takes `beforePx` of their shared `totalPx`. */\n private resizeSiblings(before: XuiDockPane, after: XuiDockPane, beforePx: number, totalPx: number): void {\n if (totalPx <= 0) {\n return;\n }\n\n const share = (before.size ?? 1) + (after.size ?? 1);\n\n before.size = (share * beforePx) / totalPx;\n after.size = share - before.size;\n this.commit({ normalize: false });\n }\n\n // ─── floating windows ─────────────────────────────────────────────────────\n\n protected startFloatingResize(window: XuiDockSplitPane, handle: string, event: PointerEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const startX = event.clientX;\n const startY = event.clientY;\n const origin = window.floatingLocation ?? FLOATING_ORIGIN;\n const width = window.floatingWidth ?? 400;\n const height = window.floatingHeight ?? 300;\n // In RTL the window is positioned from the right edge, so a rightward drag\n // moves its inline start the other way.\n const sign = this.direction() === 'rtl' ? -1 : 1;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const dx = (moveEvent.clientX - startX) * sign;\n const dy = moveEvent.clientY - startY;\n const location = { ...origin };\n let nextWidth = width;\n let nextHeight = height;\n\n if (handle.includes('left')) {\n nextWidth = Math.max(MIN_PANE_SIZE * 2, width - dx);\n location.x = origin.x + (width - nextWidth);\n } else if (handle.includes('right')) {\n nextWidth = Math.max(MIN_PANE_SIZE * 2, width + dx);\n }\n\n if (handle.includes('top')) {\n nextHeight = Math.max(MIN_PANE_SIZE * 2, height - dy);\n location.y = origin.y + (height - nextHeight);\n } else if (handle.includes('bottom')) {\n nextHeight = Math.max(MIN_PANE_SIZE * 2, height + dy);\n }\n\n window.floatingLocation = location;\n window.floatingWidth = nextWidth;\n window.floatingHeight = nextHeight;\n this.commit({ normalize: false });\n };\n\n this.trackPointer(event, onMove);\n }\n\n // ─── dragging panes and docking ───────────────────────────────────────────\n\n /**\n * Start a drag on a pane header, a tab, or a floating window's title bar.\n *\n * A window drag moves the window as it goes and docks it if it is released over\n * a valid target; a pane drag shows a ghost and either docks the pane or floats\n * it where it was dropped.\n */\n protected startPaneDrag(pane: XuiDockPane, window: XuiDockSplitPane | null, event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n\n const startX = event.clientX;\n const startY = event.clientY;\n const origin = window?.floatingLocation ?? FLOATING_ORIGIN;\n const sign = this.direction() === 'rtl' ? -1 : 1;\n let started = false;\n\n const onMove = (moveEvent: PointerEvent): void => {\n const dx = moveEvent.clientX - startX;\n const dy = moveEvent.clientY - startY;\n\n if (!started) {\n if (Math.hypot(dx, dy) < DRAG_THRESHOLD) {\n return;\n }\n\n started = true;\n this.paneDragStart.emit(pane);\n }\n\n if (window) {\n window.floatingLocation = { x: origin.x + dx * sign, y: origin.y + dy };\n this.commit({ normalize: false });\n }\n\n this.drag.set({ pane, window, x: moveEvent.clientX, y: moveEvent.clientY });\n this.updateDropTarget(moveEvent.clientX, moveEvent.clientY);\n };\n\n const onUp = (upEvent: PointerEvent): void => {\n if (!started) {\n return;\n }\n\n const target = this.dropTarget();\n this.clearDrag();\n\n if (target) {\n this.dockPane(pane, target.pane, target.position);\n } else if (!window) {\n this.floatAtPointer(pane, upEvent.clientX, upEvent.clientY);\n }\n\n this.paneDragEnd.emit(pane);\n };\n\n this.trackPointer(event, onMove, onUp);\n }\n\n protected cancelDrag(): void {\n const state = this.drag();\n\n this.clearDrag();\n this.stopPointerTracking();\n\n if (state) {\n this.paneDragEnd.emit(state.pane);\n }\n }\n\n private clearDrag(): void {\n this.drag.set(null);\n this.dropTarget.set(null);\n this.dropRect.set(null);\n this.dockIndicators.set([]);\n }\n\n private floatAtPointer(pane: XuiDockPane, clientX: number, clientY: number): void {\n const rect = this.el.getBoundingClientRect();\n const inlineOffset = this.direction() === 'rtl' ? rect.right - clientX : clientX - rect.left;\n\n this.floatPane(pane, { x: Math.round(inlineOffset - 40), y: Math.round(clientY - rect.top - 12) });\n }\n\n /**\n * Work out where a drop at these coordinates would land, and size the preview\n * rectangle to match.\n *\n * The dock manager's own edges win over whatever pane happens to be under the\n * pointer, so there is always a way to dock against the full height or width of\n * the layout.\n */\n private updateDropTarget(clientX: number, clientY: number): void {\n const state = this.drag();\n\n if (!state) {\n return;\n }\n\n const hostRect = this.el.getBoundingClientRect();\n const hovered = this.paneAt(clientX, clientY);\n const indicators = this.buildIndicators(state.pane, hovered, hostRect);\n const x = clientX - hostRect.left;\n const y = clientY - hostRect.top;\n\n // Landing on an indicator is an explicit choice and always wins.\n const hit = indicators.find(\n indicator =>\n x >= indicator.left &&\n x <= indicator.left + INDICATOR_SIZE &&\n y >= indicator.top &&\n y <= indicator.top + INDICATOR_SIZE\n );\n\n const target = hit\n ? { pane: hit.pane, position: hit.position }\n : this.looseTargetAt(state, hovered, clientX, clientY);\n\n this.dockIndicators.set(\n indicators.map(indicator => ({\n ...indicator,\n active: !!target && indicator.pane === target.pane && indicator.position === target.position\n }))\n );\n\n if (!target) {\n this.dropTarget.set(null);\n this.dropRect.set(null);\n return;\n }\n\n const rect = this.elementForPane(target.pane)?.getBoundingClientRect() ?? hostRect;\n\n this.dropTarget.set(target);\n this.dropRect.set(this.previewRect(rect, hostRect, target.position));\n }\n\n /**\n * The target for a drop that missed every indicator.\n *\n * A header or tab drag has no purpose other than docking, so the whole pane\n * stays live and the nearest edge wins. Dragging a floating window is mostly\n * about *moving* it, so it docks from the indicators alone.\n */\n private looseTargetAt(\n state: DragState,\n hovered: XuiDockPane | null,\n clientX: number,\n clientY: number\n ): DropTarget | null {\n if (state.window) {\n return null;\n }\n\n const hostRect = this.el.getBoundingClientRect();\n const target = this.outerEdgeAt(clientX, clientY, hostRect) ?? this.zoneTargetAt(hovered, clientX, clientY);\n\n return target && canDockInto(this.layout(), state.pane, target.pane, target.position) ? target : null;\n }\n\n /**\n * The joystick over the pane under the pointer, plus the outer ring that docks\n * against the whole layout — Visual Studio's docking targets.\n *\n * Only the positions the dragged pane is actually allowed to take are built, so\n * a document dragged over a tool window simply offers nothing.\n */\n private buildIndicators(dragged: XuiDockPane, hovered: XuiDockPane | null, hostRect: DOMRect): DockIndicator[] {\n const ltr = this.direction() !== 'rtl';\n const root = this.layout().rootPane;\n const step = INDICATOR_SIZE + INDICATOR_GAP;\n const half = INDICATOR_SIZE / 2;\n const far = INDICATOR_INSET + INDICATOR_SIZE;\n const candidates: Omit<DockIndicator, 'active' | 'key'>[] = [];\n\n const push = (pane: XuiDockPane, side: DockIndicator['side'], left: number, top: number): void => {\n const position: XuiDockPosition =\n side === 'center'\n ? 'center'\n : side === 'top' || side === 'bottom'\n ? side\n : (side === 'left') === ltr\n ? 'start'\n : 'end';\n\n if (canDockInto(this.layout(), dragged, pane, position)) {\n candidates.push({ pane, position, side, left, top });\n }\n };\n\n // The outer ring, pinned to the middle of each of the dock manager's edges.\n push(root, 'top', hostRect.width / 2 - half, INDICATOR_INSET);\n push(root, 'bottom', hostRect.width / 2 - half, hostRect.height - far);\n push(root, 'left', INDICATOR_INSET, hostRect.height / 2 - half);\n push(root, 'right', hostRect.width - far, hostRect.height / 2 - half);\n\n if (hovered) {\n const rect = this.elementForPane(hovered)?.getBoundingClientRect();\n\n if (rect && rect.width >= INDICATOR_MIN_PANE && rect.height >= INDICATOR_MIN_PANE) {\n const left = rect.left - hostRect.left + rect.width / 2 - half;\n const top = rect.top - hostRect.top + rect.height / 2 - half;\n\n push(hovered, 'center', left, top);\n push(hovered, 'left', left - step, top);\n push(hovered, 'right', left + step, top);\n push(hovered, 'top', left, top - step);\n push(hovered, 'bottom', left, top + step);\n }\n }\n\n return candidates.map(candidate => ({\n ...candidate,\n key: `${dockPaneKey(candidate.pane)}-${candidate.position}-${candidate.side}`,\n active: false\n }));\n }\n\n /** A drop within `OUTER_EDGE` of the dock manager's frame docks the whole layout. */\n private outerEdgeAt(clientX: number, clientY: number, hostRect: DOMRect): DropTarget | null {\n if (clientX < hostRect.left || clientX > hostRect.right || clientY < hostRect.top || clientY > hostRect.bottom) {\n return null;\n }\n\n const root = this.layout().rootPane;\n const ltr = this.direction() !== 'rtl';\n\n if (clientX - hostRect.left < OUTER_EDGE) {\n return { pane: root, position: ltr ? 'start' : 'end' };\n }\n\n if (hostRect.right - clientX < OUTER_EDGE) {\n return { pane: root, position: ltr ? 'end' : 'start' };\n }\n\n if (clientY - hostRect.top < OUTER_EDGE) {\n return { pane: root, position: 'top' };\n }\n\n if (hostRect.bottom - clientY < OUTER_EDGE) {\n return { pane: root, position: 'bottom' };\n }\n\n return null;\n }\n\n /**\n * The pane under the pointer.\n *\n * Hit-tested against the rendered rectangles rather than `elementFromPoint`, so\n * the drag ghost, the indicators and the floating window riding along with the\n * pointer cannot get in the way. The innermost rectangle wins, and on a tie the\n * one painted last does.\n */\n private paneAt(clientX: number, clientY: number): XuiDockPane | null {\n const dragged = this.drag()?.window;\n const draggedEl = dragged ? this.el.querySelector(`[data-dock-window=\"${dockPaneKey(dragged)}\"]`) : null;\n let element: HTMLElement | null = null;\n let smallest = Number.POSITIVE_INFINITY;\n\n for (const candidate of this.el.querySelectorAll<HTMLElement>('[data-dock-key]')) {\n // A collapsed pane's fly-out is a transient overlay, not a dock.\n if (draggedEl?.contains(candidate) || candidate.closest('[data-dock-flyout]')) {\n continue;\n }\n\n const bounds = candidate.getBoundingClientRect();\n\n if (\n clientX < bounds.left ||\n clientX > bounds.right ||\n clientY < bounds.top ||\n clientY > bounds.bottom ||\n bounds.width * bounds.height > smallest\n ) {\n continue;\n }\n\n element = candidate;\n smallest = bounds.width * bounds.height;\n }\n\n return element ? this.paneForKey(element.dataset['dockKey'] ?? '') : null;\n }\n\n /** Split `pane` along whichever edge the pointer sits nearest, or tab at its centre. */\n private zoneTargetAt(pane: XuiDockPane | null, clientX: number, clientY: number): DropTarget | null {\n const rect = pane && this.elementForPane(pane)?.getBoundingClientRect();\n\n if (!pane || !rect) {\n return null;\n }\n\n const u = rect.width ? (clientX - rect.left) / rect.width : 0.5;\n const v = rect.height ? (clientY - rect.top) / rect.height : 0.5;\n\n if (u > CENTRE_ZONE && u < 1 - CENTRE_ZONE && v > CENTRE_ZONE && v < 1 - CENTRE_ZONE) {\n return { pane, position: 'center' };\n }\n\n const ltr = this.direction() !== 'rtl';\n const edges = [\n { position: (ltr ? 'start' : 'end') as XuiDockPosition, fraction: u },\n { position: (ltr ? 'end' : 'start') as XuiDockPosition, fraction: 1 - u },\n { position: 'top' as XuiDockPosition, fraction: v },\n { position: 'bottom' as XuiDockPosition, fraction: 1 - v }\n ];\n\n return { pane, position: edges.reduce((a, b) => (b.fraction < a.fraction ? b : a)).position };\n }\n\n /** The slice of `rect` a drop would occupy, in coordinates relative to the host. */\n private previewRect(rect: DOMRect, hostRect: DOMRect, position: XuiDockPosition): Rect {\n const left = rect.left - hostRect.left;\n const top = rect.top - hostRect.top;\n const ltr = this.direction() !== 'rtl';\n const half = { width: rect.width / 2, height: rect.height / 2 };\n\n switch (position) {\n case 'center':\n return { left, top, width: rect.width, height: rect.height };\n case 'top':\n return { left, top, width: rect.width, height: half.height };\n case 'bottom':\n return { left, top: top + half.height, width: rect.width, height: half.height };\n case 'start':\n return { left: ltr ? left : left + half.width, top, width: half.width, height: rect.height };\n case 'end':\n return { left: ltr ? left + half.width : left, top, width: half.width, height: rect.height };\n }\n }\n\n private elementForPane(pane: XuiDockPane): HTMLElement | null {\n return this.el.querySelector<HTMLElement>(`[data-dock-key=\"${dockPaneKey(pane)}\"]`);\n }\n\n private paneForKey(key: string): XuiDockPane | null {\n let found: XuiDockPane | null = null;\n\n const walk = (pane: XuiDockPane): void => {\n if (dockPaneKey(pane) === key) {\n found = pane;\n return;\n }\n\n if (isSplitPane(pane) || isTabGroupPane(pane)) {\n pane.panes.forEach(walk);\n } else if (isDocumentHost(pane)) {\n walk(pane.rootPane);\n }\n };\n\n const layout = this.layout();\n\n for (const root of [layout.rootPane, ...(layout.floatingPanes ?? [])]) {\n if (found) {\n break;\n }\n\n walk(root);\n }\n\n return found;\n }\n\n // ─── pointer plumbing ─────────────────────────────────────────────────────\n\n private readonly pointerDrag = injectXPointerDrag();\n private release: XPointerDragStop | null = null;\n\n /** Follow the pointer until it is released, then clean up after ourselves. */\n private trackPointer(\n event: PointerEvent,\n onMove: (event: PointerEvent) => void,\n onUp?: (event: PointerEvent) => void\n ): void {\n this.release = this.pointerDrag(event, { onMove, onEnd: onUp });\n }\n\n private stopPointerTracking(): void {\n this.release?.();\n this.release = null;\n }\n\n // ─── layout bookkeeping ───────────────────────────────────────────────────\n\n /**\n * Publish the in-place edits made to the tree.\n *\n * Skip normalisation for the continuous gestures — a resize or a window move\n * cannot change the tree's shape, and re-walking it on every pointer event is\n * wasted work.\n */\n private commit(options?: { normalize?: boolean }): void {\n const layout = this.layout();\n\n if (options?.normalize !== false) {\n normalizeDockLayout(layout);\n }\n\n this.layout.set({ ...layout });\n }\n\n private contentPanesOf(pane: XuiDockPane): XuiDockContentPane[] {\n const out: XuiDockContentPane[] = [];\n\n const walk = (current: XuiDockPane): void => {\n if (isContentPane(current)) {\n out.push(current);\n } else if (isSplitPane(current) || isTabGroupPane(current)) {\n current.panes.forEach(walk);\n } else if (isDocumentHost(current)) {\n walk(current.rootPane);\n }\n };\n\n walk(pane);\n\n return out;\n }\n\n private tabGroupOf(pane: XuiDockContentPane): XuiDockTabGroupPane | null {\n let group: XuiDockTabGroupPane | null = null;\n\n const walk = (current: XuiDockPane): void => {\n if (group) {\n return;\n }\n\n if (isTabGroupPane(current)) {\n if (current.panes.includes(pane)) {\n group = current;\n return;\n }\n\n return;\n }\n\n if (isSplitPane(current)) {\n current.panes.forEach(walk);\n } else if (isDocumentHost(current)) {\n walk(current.rootPane);\n }\n };\n\n const layout = this.layout();\n\n for (const root of [layout.rootPane, ...(layout.floatingPanes ?? [])]) {\n walk(root);\n }\n\n return group;\n }\n\n // ─── keyboard ─────────────────────────────────────────────────────────────\n\n protected onTabKeydown(group: XuiDockTabGroupPane, event: KeyboardEvent): void {\n const tabs = this.pinnedTabs(group);\n\n if (!tabs.length) {\n return;\n }\n\n const step = arrowDirectionOnAxis(event.key, this.direction(), 'horizontal');\n const current = tabs.indexOf(this.selectedTab(group) as XuiDockContentPane);\n let next: number;\n\n if (step === 'next') {\n next = (current + 1) % tabs.length;\n } else if (step === 'previous') {\n next = (current - 1 + tabs.length) % tabs.length;\n } else if (event.key === 'Home') {\n next = 0;\n } else if (event.key === 'End') {\n next = tabs.length - 1;\n } else {\n return;\n }\n\n event.preventDefault();\n this.selectPane(tabs[next]);\n\n // Roving tabindex: follow the selection with focus.\n const strip = (event.currentTarget as HTMLElement).parentElement;\n strip?.querySelectorAll<HTMLElement>('[role=\"tab\"]')[next]?.focus();\n }\n\n // ─── classes ──────────────────────────────────────────────────────────────\n\n protected readonly computedClass = computed(() =>\n xui('bg-surface text-foreground relative flex flex-col overflow-hidden text-sm select-none', this.class())\n );\n\n protected splitClass(pane: XuiDockPane): string {\n return xui('flex min-h-0 min-w-0 flex-1', isSplitPane(pane) && pane.orientation === 'vertical' && 'flex-col');\n }\n\n protected frameClass(pane: XuiDockPane): string {\n return xui(\n 'border-border bg-surface flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-md border',\n this.isActiveFrame(pane) && 'border-primary-muted'\n );\n }\n\n /** Whether the pane on screen in this frame is the active one. */\n private isActiveFrame(pane: XuiDockPane): boolean {\n const active = this.activePane();\n\n if (!active) {\n return false;\n }\n\n return isTabGroupPane(pane) ? this.selectedTab(pane) === active : pane === active;\n }\n\n protected headerClass(pane: XuiDockPane): string {\n return xui(\n 'border-border bg-surface-raised text-foreground-muted flex h-8 shrink-0 items-center gap-1 border-b ps-2 pe-1',\n 'text-xs font-medium',\n // The header is a drag handle; without this a touch drag scrolls the page\n // instead of moving the pane.\n 'touch-none',\n isContentPane(pane) && 'cursor-grab'\n );\n }\n\n protected tabStripClass(): string {\n return xui('border-border bg-surface-raised flex h-8 shrink-0 touch-none items-center gap-0.5 border-b px-1');\n }\n\n protected tabClass(group: XuiDockTabGroupPane, tab: XuiDockContentPane): string {\n return xui(\n 'group relative flex h-8 max-w-40 shrink-0 cursor-grab items-center gap-1 rounded-t px-2 text-xs',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus',\n tab === this.selectedTab(group)\n ? 'bg-surface text-foreground border-border border-x border-t'\n : 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground'\n );\n }\n\n protected tabCloseClass(): string {\n return xui('hover:bg-hover-overlay grid size-4 shrink-0 place-items-center rounded opacity-60 hover:opacity-100');\n }\n\n protected actionClass(): string {\n return xui(\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground grid size-6 shrink-0 place-items-center',\n 'rounded focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus'\n );\n }\n\n protected gutterClass(pane: XuiDockPane): string {\n return xui(\n // eslint-disable-next-line local/no-hand-z-index -- the resize gutter rides above pane content on the dock’s internal z scale\n 'group relative z-10 flex shrink-0 touch-none items-center justify-center',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus',\n isSplitPane(pane) && pane.orientation === 'vertical'\n ? 'h-1.5 w-full cursor-row-resize'\n : 'w-1.5 cursor-col-resize'\n );\n }\n\n protected gutterHandleClass(pane: XuiDockPane): string {\n return xui(\n 'bg-border group-hover:bg-primary rounded-full transition-colors',\n isSplitPane(pane) && pane.orientation === 'vertical' ? 'h-0.5 w-8' : 'h-8 w-0.5'\n );\n }\n\n protected stripClass(location: XuiDockUnpinnedLocation): string {\n const vertical = location === 'start' || location === 'end';\n\n return xui(\n 'border-border bg-surface-inset flex shrink-0 items-start gap-1 p-1',\n vertical ? 'w-8 flex-col' : 'h-8',\n location === 'start' && 'border-e',\n location === 'end' && 'border-s',\n location === 'top' && 'border-b',\n location === 'bottom' && 'border-t'\n );\n }\n\n protected stripTabClass(location: XuiDockUnpinnedLocation, pane: XuiDockContentPane): string {\n const vertical = location === 'start' || location === 'end';\n\n return xui(\n 'text-foreground-muted hover:bg-hover-overlay hover:text-foreground max-h-40 max-w-40 truncate rounded px-1.5 py-1',\n 'text-xs focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus',\n vertical && '[writing-mode:vertical-rl]',\n pane === this.flyout() && 'bg-primary-muted text-foreground'\n );\n }\n\n protected flyoutClass(): string {\n // eslint-disable-next-line local/no-hand-z-index -- flyouts stack on the dock manager’s internal z scale\n return xui('bg-surface border-border shadow-overlay absolute z-20 flex overflow-hidden border');\n }\n\n protected flyoutStyle(pane: XuiDockContentPane): Record<string, string> {\n const location = pane.unpinnedLocation ?? defaultUnpinnedLocation(this.layout(), pane);\n const size = `${pane.unpinnedSize ?? 280}px`;\n const offset = `${STRIP_SIZE}px`;\n\n switch (location) {\n case 'start':\n return { insetInlineStart: offset, top: '0', bottom: '0', width: size };\n case 'end':\n return { insetInlineEnd: offset, top: '0', bottom: '0', width: size };\n case 'top':\n return { top: offset, insetInlineStart: '0', insetInlineEnd: '0', height: size };\n case 'bottom':\n return { bottom: offset, insetInlineStart: '0', insetInlineEnd: '0', height: size };\n }\n }\n\n protected floatingClass(): string {\n // eslint-disable-next-line local/no-hand-z-index -- floating panes stack on the dock manager’s internal z scale\n return xui('bg-surface border-border shadow-overlay absolute z-40 flex flex-col overflow-hidden rounded-lg border');\n }\n\n protected floatingStyle(window: XuiDockSplitPane): Record<string, string> {\n const location = window.floatingLocation ?? FLOATING_ORIGIN;\n\n return {\n insetInlineStart: `${location.x}px`,\n top: `${location.y}px`,\n width: `${window.floatingWidth ?? 400}px`,\n height: `${window.floatingHeight ?? 300}px`\n };\n }\n\n protected indicatorClass(indicator: DockIndicator): string {\n return xui(\n // Never interactive: the pointer is already captured by the drag, and the\n // indicators are hit-tested by rectangle rather than by event target.\n // eslint-disable-next-line local/no-hand-z-index -- drop indicators top the dock’s internal z scale during a drag\n 'bg-surface-overlay shadow-elevation-2 pointer-events-none absolute z-55 rounded border',\n indicator.active ? 'border-primary' : 'border-border-strong'\n );\n }\n\n /**\n * The shaded block inside an indicator, showing which part of the target the\n * pane will take — the same visual language as Visual Studio's dock targets.\n */\n protected indicatorFillClass(indicator: DockIndicator): string {\n const sides: Record<DockIndicator['side'], string> = {\n center: 'inset-1',\n left: 'top-1 bottom-1 left-1 w-1/3',\n right: 'top-1 bottom-1 right-1 w-1/3',\n top: 'top-1 right-1 left-1 h-1/3',\n bottom: 'right-1 bottom-1 left-1 h-1/3'\n };\n\n return xui(\n 'absolute rounded-sm',\n sides[indicator.side],\n indicator.active ? 'bg-primary' : 'bg-foreground-subtle/50'\n );\n }\n\n protected titleBarClass(): string {\n return xui(\n 'border-border bg-surface-raised text-foreground-muted flex h-7 shrink-0 cursor-grab items-center gap-1',\n 'touch-none border-b ps-2 pe-1 text-xs font-medium'\n );\n }\n}\n","import { XuiDockContent } from './lib/dock-content';\nimport { XuiDockManager } from './lib/dock-manager';\n\nexport * from './lib/dock-content';\nexport * from './lib/dock-manager';\nexport * from './lib/dock-manager.types';\nexport * from './lib/dock-manager.utils';\n\nexport const XuiDockManagerImports = [XuiDockManager, XuiDockContent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;AAkBG;MAEU,cAAc,CAAA;;IAEhB,SAAS,GAAG,KAAK,CAAC,QAAQ,gFAAW,KAAK,EAAE,gBAAgB,EAAA,CAAG;AAE/D,IAAA,QAAQ,GAAG,MAAM,CAAuB,WAAW,CAAC;0HAJlD,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;8GAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,6BAA6B,EAAE,QAAQ,EAAE,gBAAgB,EAAE;;MAiBrE,wBAAwB,GAAG,IAAI,cAAc,CAAwB,uBAAuB;AAEzG;;;;AAIG;MAEU,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AACpD,IAAA,OAAO,GAAG,MAAM,CAAC,wBAAwB,CAAC;IAElD,SAAS,GAAG,KAAK,CAAC,QAAQ,gFAAW,KAAK,EAAE,sBAAsB,EAAA,CAAG;AAE9E,IAAA,WAAA,GAAA;QACE,MA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