SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Class LayerActivation

    The z-ordered layer→scope registry — the anchor source for a region whose behavior is composed from stacked layers (selection, clipboard, format painter, the cell editor, …). Each command-bearing layer registers its CommandScope at a z; this chains them (via CommandScope.setParent) into a stack ordered by z — higher z → deeper → wins — atop the region's base, and reports the top as getAnchor. The unchanged CommandScope.resolve (which walks _parent from the anchor) then resolves top-of-stack first: a stacked layer overrides a command by stacking, not by focus, and unstacking it restores the layer/base below.

    This is what makes a feature a composable layer — one that both draws and injects commands — and it is the same mechanism whether the layer is ours or a third party's. LayerActivation implements ActivationTracker, so it drops into CommandResolver / FocusActivation (as an AnchorSource, read live) with no other changes. It has no DOM element of its own — the region owns focus/keys (a pane maps its Stage element to this stack; see FocusActivation).

    Ties (equal z) keep insertion order. Reusing the same scope twice is not supported (register each layer's scope once). The base is never removed; it's the region's always-present floor.

    Implements

    Index
    • Add a layer's scope at priority z and re-chain. Returns an unregister that removes it and re-chains the rest (restoring whatever was below). The caller owns the scope's own teardown (contribution.remove() / scope.dispose()); this only manages stack membership.

      Parameters

      Returns RemoveListener

    • Fires when the anchor changes — and, for region trackers, when the region attaches/detaches.

      Parameters

      • listener: () => void

      Returns RemoveListener