Dockview
    Preparing search index...

    Class DockviewComponent

    The narrow surface the layout-history service needs from the host (DockviewComponent). It reads/writes whole-layout snapshots and listens to the mutation-transaction boundary, the only place a pre-image can be taken before a mutation runs.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    activateNext activatePrevious addDisposables addEdgeGroup addFloatingGroup addGroup addPanel addPopoutGroup adjacentGroup adjacentGroupInDirection announce autoHideEdgeGroup buildGroupDragGhost canDropOnGroup clear clearHistory closeAllGroups createGroup createWatermarkComponent currentOrigin deferLocationChange dispatchUnhandledDragOver dispose doAddGroup dockPanel dockToLayoutEdge doRemoveGroup doSetGroupActive doSetGroupAndPanelActive exitMaximizedGroup fireDidAddPanelToTabGroup fireDidCreateTabGroup fireDidDestroyTabGroup fireDidRemovePanelFromTabGroup fireDidTabGroupChange fireDidTabGroupCollapsedChange fireLayoutChange fireWillDragGroup fireWillDragPanel fireWillDrop fireWillShowOverlay floatPanel focus forceRelayout fromJSON getDropOverlayElement getDropPositionResolver getDropZoneRect getEdgeGroup getEdgeGroupExpandedSize getEdgeGroupPanel getFloatingContainer getFloatingGroupSnapshots getFloatingWindowForGroup getGridSplitterRects getGridviewForGroup getGroupPanel getLayoutElement getPanel getPopouts getPopoutWindows getPopupServiceForGroup getTabsListElement hasMaximizedGroup hasVisibleGridGroup isEdgeGroupAutoHide isEdgeGroupCollapsed isEdgeGroupPeeking isEdgeGroupVisible isGridEmpty isMaximizedGroup isVisible layout maximizeGroup mergeFloatInto moveGroup moveGroupOrPanel movingLock mutation ownsElement peekEdgeGroup pinEdgeGroup redo relayoutGroup removeDisposable removeEdgeGroup removeGroup removePanel repositionPanelOverlay resolveDropOverlayModel revealEdgeGroupWithData rootDropTargetOverrideTarget setActivePanel setEdgeGroupAutoHide setEdgeGroupCollapsed setEdgeGroupPeeking setEdgeGroupVisible setForcedOverflow setPanelPinned setSmartGuidesEnabled setVisible showDropPreview toJSON undo updateOptions updateSmartGuidesOptions withOrigin

    Constructors

    Properties

    _activeGroup: DockviewGroupPanel | undefined
    _bufferOnDidLayoutChange: AsapEvent = ...
    _groups: Map<string, IValueDisposable<DockviewGroupPanel>> = ...
    _onDidAddGroup: DockviewEmitter<DockviewGroupPanel> = ...
    floatingDropTargetContainer: DropTargetAnchorContainer

    Shell-level anchor container dedicated to floating groups. Unlike rootDropTargetContainer it is never disabled by the dndOverlayMounting: 'relative' theme setting: a floating group cannot use an in-place ('relative') overlay because the overlay would be appended inside the floating window's stacking context (.dv-resize-container, a lower z-index than the shell-level render overlay that hosts the floating panel's content) and be painted over. Routing floating groups through this always-anchored container keeps their drop overlays visible in both mounting modes.

    gridview: Gridview
    onDidActiveChange: DockviewEvent<DockviewGroupPanel | undefined> = ...
    onDidActiveGroupChange: DockviewEvent<DockviewGroupPanel | undefined> = ...
    onDidActivePanelChange: DockviewEvent<DockviewActivePanelChangeEvent> = ...
    onDidAddGroup: DockviewEvent<DockviewGroupPanel> = ...

    Fires when any group is added; the service filters for location.type === 'edge'.

    onDidAddPanel: DockviewEvent<IDockviewPanel> = ...
    onDidAddPanelToTabGroup: DockviewEvent<DockviewTabGroupPanelChangeEvent> = ...
    onDidAddPopoutGroup: DockviewEvent<PopoutGroup> = ...
    onDidChangePopouts: DockviewEvent<void> = ...

    Fires whenever a popout window opens or closes, i.e. the set of popout documents changed. Used by accessibility services that mirror per-window state (e.g. a live region in each popout).

    onDidCreateTabGroup: DockviewEvent<DockviewTabGroupChangeEvent> = ...
    onDidDestroyTabGroup: DockviewEvent<DockviewTabGroupChangeEvent> = ...
    onDidEdgeGroupAutoHideChange: DockviewEvent<DockviewGroupPanel> = ...

    Fires when a group's resolved auto-hide state changes at runtime (per-group setAutoHide), so a controller can dock/undock retroactively.

    onDidEndFloatingGroupDrag: DockviewEvent<DockviewGroupPanel> = ...

    Fires with the dragged group when a floating group's move/resize drag ends. Consumed by the Smart Guides service (ISmartGuidesHost) to tear down its per-drag guides.

    onDidLayoutChange: DockviewEvent<void> = ...

    Coalesced (microtask-buffered) ping after any layout change; the only signal for sash resize, which does not go through the mutation boundary.

    onDidLayoutFromJSON: DockviewEvent<void> = ...
    onDidMaximizedChange: DockviewEvent<MaximizedChanged<DockviewGroupPanel>> = ...
    onDidMaximizedGroupChange: DockviewEvent<DockviewMaximizedGroupChangeEvent> = ...
    onDidMovePanel: DockviewEvent<MovePanelEvent> = ...
    onDidMutateLayout: DockviewEvent<DockviewLayoutMutationEvent> = ...

    Fires after a structural mutation; used to capture the post-image.

    onDidOpenPopoutWindowFail: DockviewEvent<void> = ...
    onDidOptionsChange: DockviewEvent<void> = ...

    Fires after updateOptions; the service re-applies wrap to every group so a runtime overflow.mode change takes effect.

    onDidPanelPinnedChange: DockviewEvent<DockviewPanelPinnedChangeEvent> = ...
    onDidPopoutGroupPositionChange: DockviewEvent<PopoutGroupChangePositionEvent> = ...
    onDidPopoutGroupSizeChange: DockviewEvent<PopoutGroupChangeSizeEvent> = ...
    onDidRemove: DockviewEvent<DockviewGroupPanel> = ...
    onDidRemoveGroup: DockviewEvent<DockviewGroupPanel> = ...
    onDidRemovePanel: DockviewEvent<IDockviewPanel> = ...
    onDidRemovePanelFromTabGroup: DockviewEvent<DockviewTabGroupPanelChangeEvent> = ...
    onDidRemovePopoutGroup: DockviewEvent<PopoutGroup> = ...
    onDidStartFloatingGroupDrag: DockviewEvent<DockviewGroupPanel> = ...

    Fires with the dragged group when a floating group move-drag first moves. Consumed by the Smart Guides service (ISmartGuidesHost) to start each drag from a clean slate (a redock long-press aborts with no end event).

    onDidTabGroupChange: DockviewEvent<DockviewTabGroupChangeEvent> = ...
    onDidTabGroupCollapsedChange: DockviewEvent<DockviewTabGroupChangeEvent> = ...
    onDidViewVisibilityChangeMicroTaskQueue: DockviewEvent<void> = ...
    onUnhandledDragOver: DockviewEvent<DockviewDndOverlayEvent> = ...
    onWillDragGroup: DockviewEvent<GroupDragEvent> = ...
    onWillDragPanel: DockviewEvent<TabDragEvent> = ...
    onWillMutateLayout: DockviewEvent<DockviewLayoutMutationEvent> = ...

    Fires before / after a structural layout change; used to restore focus on close.

    Fires on each drag-over with the hovered group + native event; the signal the compass widget mounts/follows. The service filters for kind === 'content'.

    overlayRenderContainer: OverlayRenderContainer
    popupService: PopupService
    rootDropTargetContainer: DropTargetAnchorContainer

    Accessors

    • get disableResizing(): boolean

      Returns boolean

    • set disableResizing(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get hasEdgeDragReveal(): boolean

      Whether the two-band edge drag-reveal affordance is registered. See IRootDropTargetHost.hasEdgeDragReveal; must not be read during module initialisation, only from init/postConstruct onwards.

      Returns boolean

    • get isDisposed(): boolean

      Returns boolean

    Methods

    • Coalesce a panel's onDidLocationChange to the end of the enclosing transaction, or fire it immediately when no transaction is in flight.

      Relocating a panel touches its location twice: once as it is reparented into the destination group - which, when that group has just been created for a floating or popout window, has not been told where it lives yet - and once as the group is tagged with its final location. Reporting each signal as it happens therefore leaks an intermediate grid location the panel was never in, at a moment when it belongs to neither group's panel list and so is missing from api.panels.

      Deferring collapses those signals into a single event carrying the settled location. Note the signals are deliberately not compared against the panel's previous location: a panel can move between two floating windows without its location type changing, and this event is the only signal OverlayRenderContainer has to re-resolve the panel's z-index against its new host window.

      Parameters

      • key: object
      • fire: () => void

      Returns void

    • Build, fire, and return the verdict for an unhandled-drag-over event. Implemented on the component side so the service stays free of circular imports with the event class declared in dockviewComponent.

      Parameters

      • nativeEvent: DragEvent | PointerEvent
      • position: Position

      Returns boolean

    • Dock the dragged item against the whole-layout edge at position (the orthogonalized root group), as the layout-edge drop zones do. Shared by the root drop target and by an edge-flagged drop on a group content target (a position resolver that marks an outer "dock to the layout edge" cell). No-op when there is no active drag data.

      Parameters

      • nativeEvent: DragEvent | PointerEvent
      • position: Position

      Returns void

    • The drop-position resolver installed on the group content drop targets: the app's dropPositionResolver option if set, else the DnD compass module's compass resolver (undefined when the compass is disabled). Read live by the content drop targets; undefined ⇒ default cursor-quadrant.

      Returns PositionResolver | undefined

    • Viewport rect of the docked content area (the element the root/group drop targets hit-test against), used by the two-band drag-reveal affordance to classify a pointer's distance from each edge. This is the gridview/center container, which is inset when edge groups are present, so the outer band sits at the boundary of the content area (adjacent to any existing edge group) rather than at the shell's outer edge.

      Returns DOMRect

    • Resolve the floating window hosting group, matched by membership so it finds nested (non-anchor) members too — a floating window can host a whole nested gridview, not just its anchor group. Returns undefined when the group isn't in any floating window. floatingGroups alone only exposes each window's anchor, so consumers that must act on any member (e.g. lifting an always-rendered panel's overlay above the window) should use this instead of a .find(f => f.group === group).

      Parameters

      Returns DockviewFloatingGroupPanel | undefined

    • Bracket a structural mutation with onWillMutateLayout / onDidMutateLayout. Re-entrant: nested calls (a compound operation such as a drag that relocates a panel) join the outermost transaction, so the events fire exactly once around the whole operation. kind reflects the outermost mutation.

      Type Parameters

      • T

      Parameters

      Returns T

    • Does this dock own node, in any of its windows? True when the node is inside the main shell, or inside one of this component's popout documents. A popout window hosts only this component's content, so whole-document membership is sufficient there; the main document may hold sibling docks, so it must be a containment check. A same-document popout (the jsdom mock) is already covered by the main check and contributes nothing.

      Parameters

      • node: Node

      Returns boolean

    • Parameters

      • panel: IDockviewPanel
      • Optionaloptions: {
            removeEmptyGroup?: boolean;
            skipDispose?: boolean;
            skipSetActiveGroup?: boolean;
        }

      Returns void

    • Reposition a single renderer:'always' panel's overlay over its reference container, optionally forcing it visible (the auto-hide peek slides an always panel out without reparenting it or touching its visibility state). No-op for non-overlay-rendered panels.

      Parameters

      Returns void

    • Reveal (create-or-fill) the edge group at position and move the dragged item described by data into it. A newly created edge group is created collapsed, flagged autoReveal so it tears down to zero footprint when later emptied, and takes its auto-hide state from options.autoHide. If an edge group already exists there it is reused: the panel is added to its tabs and its collapsed/toggled and auto-hide state are left as-is (never re-created; addEdgeGroup throws on a duplicate position). This keeps a drag-reveal from silently converting a static edge group into an auto-hiding one; to change an existing group's auto-hide, call api.getEdgeGroup(position)?.setAutoHide(...) directly. No-op if the EdgeGroup module is absent.

      This is the primitive behind the dock-to-edge groups: the two-band drag-reveal affordance routes its outer-band drops here.

      Parameters

      • position: EdgeGroupPosition
      • data: { groupId: string; panelId?: string | null }
      • Optionaloptions: { autoHide?: boolean }

      Returns void

    • Returns DropTargetTargetModel | undefined

    • Pin/unpin a panel's tab. The single gated entry point behind panel.api.setPinned. Dormant unless pinnedTabs.enabled is set (a silent no-op), and a silent no-op when the PinnedTabs module is not registered: reaching past the enabled check means the option was set, so the option rule has already named the missing module. When active it mutates the panel's pinned flag (which fires panel.api.onDidChangePinned) and the component-level onDidPanelPinnedChange; the module reacts to enforce pinned-first ordering.

      Parameters

      Returns void

    • Run func with the operation origin set to origin, restoring the previous value afterwards. Used by the DockviewApi boundary to tag programmatic operations as 'api', and by user-gesture handlers to tag 'user'. Only the outermost caller sets the origin; a nested call (or a call made while a mutation is already in flight) keeps whatever the enclosing operation established, so the trigger always wins.

      Type Parameters

      • T

      Parameters

      Returns T