dockview-core 8.1.0 → 8.2.0

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.
@@ -101,5 +101,17 @@ export declare class DockviewPanelApiImpl extends GridviewPanelApiImpl implement
101
101
  maximize(): void;
102
102
  isMaximized(): boolean;
103
103
  exitMaximized(): void;
104
+ /**
105
+ * Report that this panel's location may have moved.
106
+ *
107
+ * A relocation touches the location more than once - the panel is
108
+ * reparented into the destination group, then that group is tagged with
109
+ * the location it ends up at - so the event is coalesced to the end of the
110
+ * enclosing layout mutation and reports where the panel actually settled.
111
+ * Firing each signal as it happened surfaced an intermediate `grid`
112
+ * location the panel was never in, at a point where it was in neither
113
+ * group's panel list. Outside a mutation this fires straight away.
114
+ */
115
+ private fireLocationChange;
104
116
  private setupGroupEventListeners;
105
117
  }
@@ -111,6 +111,11 @@ export interface SerializedDockview {
111
111
  export interface MovePanelEvent {
112
112
  panel: IDockviewPanel;
113
113
  from: DockviewGroupPanel;
114
+ /**
115
+ * The group the panel now belongs to. Equal to `from` when the panel kept
116
+ * its group and the group itself was relocated.
117
+ */
118
+ to: DockviewGroupPanel;
114
119
  }
115
120
  type MoveGroupOptions = {
116
121
  from: {
@@ -345,6 +350,7 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
345
350
  private readonly _onWillDrop;
346
351
  readonly onWillDrop: Event<DockviewWillDropEvent>;
347
352
  private _mutationDepth;
353
+ private readonly _pendingLocationChanges;
348
354
  private _origin;
349
355
  private _originDepth;
350
356
  private readonly _onWillMutateLayout;
@@ -856,6 +862,56 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
856
862
  * outermost mutation.
857
863
  */
858
864
  mutation<T>(kind: DockviewLayoutMutationKind, func: () => T): T;
865
+ /**
866
+ * `mutation()` for an operation whose work continues after the synchronous
867
+ * call returns. The transaction stays open until the returned promise
868
+ * settles, so everything the operation does - the group it adds, the panels
869
+ * it relocates - lands inside the bracket, matching the synchronous
870
+ * move / float paths.
871
+ */
872
+ private mutationAsync;
873
+ /**
874
+ * Open a transaction and return the function that closes it. Shared by the
875
+ * synchronous and asynchronous brackets; the returned function must be
876
+ * called exactly once.
877
+ *
878
+ * Both ends key off the depth counter reaching zero rather than off which
879
+ * bracket opened first. For synchronous nesting the two are the same thing
880
+ * - brackets close in the order they opened - but asynchronous transactions
881
+ * can *overlap* rather than nest (two `addPopoutGroup` calls in flight at
882
+ * once, or a restore staggering several), and there the first to open is
883
+ * not the last to close. Reporting on the opener would fire `didMutate`
884
+ * while the other transaction was still doing structural work, which is the
885
+ * very thing the async bracket exists to prevent. Overlapping transactions
886
+ * therefore report as one, tagged with the kind of the last to finish.
887
+ */
888
+ private openMutation;
889
+ /**
890
+ * Coalesce a panel's `onDidLocationChange` to the end of the enclosing
891
+ * transaction, or fire it immediately when no transaction is in flight.
892
+ *
893
+ * Relocating a panel touches its location twice: once as it is reparented
894
+ * into the destination group - which, when that group has just been created
895
+ * for a floating or popout window, has not been told where it lives yet -
896
+ * and once as the group is tagged with its final location. Reporting each
897
+ * signal as it happens therefore leaks an intermediate `grid` location the
898
+ * panel was never in, at a moment when it belongs to neither group's panel
899
+ * list and so is missing from `api.panels`.
900
+ *
901
+ * Deferring collapses those signals into a single event carrying the
902
+ * settled location. Note the signals are deliberately *not* compared
903
+ * against the panel's previous location: a panel can move between two
904
+ * floating windows without its location type changing, and this event is
905
+ * the only signal `OverlayRenderContainer` has to re-resolve the panel's
906
+ * z-index against its new host window.
907
+ */
908
+ deferLocationChange(key: object, fire: () => void): void;
909
+ /**
910
+ * Report every panel whose location moved during the transaction that has
911
+ * just closed. Each callback reads the panel's location at this point, so
912
+ * what it reports is where the panel ended up.
913
+ */
914
+ private flushLocationChanges;
859
915
  /**
860
916
  * The origin of the operation currently in progress (`'user'` by default).
861
917
  * Read inside a `mutation()` or active-panel change to learn whether the
@@ -877,6 +933,12 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
877
933
  * {@link DockviewOrigin}. Callers keep their own dedupe guards.
878
934
  */
879
935
  private fireActivePanelChange;
936
+ /**
937
+ * Announce that `panel` has finished relocating. Must be called once the
938
+ * move has settled: `to` is read from the panel's current group, so an
939
+ * early call would report the source group as the destination.
940
+ */
941
+ private fireDidMovePanel;
880
942
  moveGroupOrPanel(options: MoveGroupOrPanelOptions): void;
881
943
  private _doMoveGroupOrPanel;
882
944
  private moveTabGroupToGroup;
@@ -12,8 +12,13 @@ export declare class OverlayRenderContainer extends CompositeDisposable {
12
12
  readonly accessor: DockviewComponent;
13
13
  private readonly map;
14
14
  private _disposed;
15
+ /**
16
+ * Monotonic for the container's lifetime, never per-entry: `detatch()`
17
+ * deletes the entry, so an entry-local counter would restart and let a
18
+ * superseded closure collide with a later `attach`.
19
+ */
20
+ private _generation;
15
21
  private readonly positionCache;
16
- private readonly pendingUpdates;
17
22
  constructor(element: HTMLElement, accessor: DockviewComponent);
18
23
  updateAllPositions(): void;
19
24
  /**
@@ -24,6 +29,13 @@ export declare class OverlayRenderContainer extends CompositeDisposable {
24
29
  * the panel's visibility state. No-op if the panel isn't overlay-rendered.
25
30
  */
26
31
  repositionPanelOverlay(panelId: string, forceVisible?: boolean, clip?: DOMRect): void;
32
+ /**
33
+ * Drop the reposition frame queued for a panel, if any. A queued frame is
34
+ * bound to the reference container that was current when it was scheduled,
35
+ * so it must be discarded whenever that container stops being the one the
36
+ * overlay should track.
37
+ */
38
+ private cancelPendingUpdate;
27
39
  detatch(panel: IDockviewPanel): boolean;
28
40
  attach(options: {
29
41
  panel: IDockviewPanel;