dockview-core 6.6.0 → 7.0.2

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.
Files changed (153) hide show
  1. package/README.md +8 -1
  2. package/dist/cjs/api/component.api.d.ts +42 -21
  3. package/dist/cjs/api/component.api.js +111 -20
  4. package/dist/cjs/api/dockviewGroupPanelApi.d.ts +23 -8
  5. package/dist/cjs/api/dockviewGroupPanelApi.js +23 -0
  6. package/dist/cjs/api/dockviewPanelApi.d.ts +4 -3
  7. package/dist/cjs/api/dockviewPanelApi.js +8 -0
  8. package/dist/cjs/dnd/droptarget.d.ts +8 -0
  9. package/dist/cjs/dnd/droptarget.js +28 -0
  10. package/dist/cjs/dockview/accessibilityMessages.d.ts +32 -0
  11. package/dist/cjs/dockview/accessibilityMessages.js +51 -0
  12. package/dist/cjs/dockview/allModules.d.ts +8 -0
  13. package/dist/cjs/dockview/allModules.js +25 -0
  14. package/dist/cjs/dockview/components/panel/content.d.ts +2 -0
  15. package/dist/cjs/dockview/components/panel/content.js +35 -4
  16. package/dist/cjs/dockview/components/tab/tab.js +33 -5
  17. package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +35 -0
  18. package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +95 -0
  19. package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +52 -0
  20. package/dist/cjs/dockview/components/titlebar/groupDragSource.js +218 -0
  21. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
  22. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +31 -24
  23. package/dist/cjs/dockview/components/titlebar/tabGroups.js +1 -0
  24. package/dist/cjs/dockview/components/titlebar/tabs.d.ts +12 -0
  25. package/dist/cjs/dockview/components/titlebar/tabs.js +105 -2
  26. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +4 -0
  27. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +13 -3
  28. package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -4
  29. package/dist/cjs/dockview/components/titlebar/voidContainer.js +31 -155
  30. package/dist/cjs/dockview/dockviewComponent.d.ts +299 -44
  31. package/dist/cjs/dockview/dockviewComponent.js +1787 -993
  32. package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
  33. package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +39 -3
  34. package/dist/cjs/dockview/dockviewGroupPanel.d.ts +0 -1
  35. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +36 -14
  36. package/dist/cjs/dockview/dockviewGroupPanelModel.js +133 -101
  37. package/dist/cjs/dockview/dockviewPanel.d.ts +2 -2
  38. package/dist/cjs/dockview/edgeGroupService.d.ts +38 -0
  39. package/dist/cjs/dockview/edgeGroupService.js +128 -0
  40. package/dist/cjs/dockview/floatingGroupService.d.ts +37 -0
  41. package/dist/cjs/dockview/floatingGroupService.js +231 -0
  42. package/dist/cjs/dockview/headerActionsService.d.ts +32 -0
  43. package/dist/cjs/dockview/headerActionsService.js +149 -0
  44. package/dist/cjs/dockview/liveRegionService.d.ts +53 -0
  45. package/dist/cjs/dockview/liveRegionService.js +185 -0
  46. package/dist/cjs/dockview/moduleContracts.d.ts +119 -0
  47. package/dist/cjs/dockview/moduleContracts.js +2 -0
  48. package/dist/cjs/dockview/modules.d.ts +110 -0
  49. package/dist/cjs/dockview/modules.js +304 -0
  50. package/dist/cjs/dockview/options.d.ts +159 -6
  51. package/dist/cjs/dockview/options.js +8 -1
  52. package/dist/cjs/dockview/popoutWindowService.d.ts +95 -0
  53. package/dist/cjs/dockview/popoutWindowService.js +261 -0
  54. package/dist/cjs/dockview/rootDropTargetService.d.ts +35 -0
  55. package/dist/cjs/dockview/rootDropTargetService.js +87 -0
  56. package/dist/cjs/dockview/watermarkService.d.ts +30 -0
  57. package/dist/cjs/dockview/watermarkService.js +61 -0
  58. package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
  59. package/dist/cjs/gridview/baseComponentGridview.js +3 -2
  60. package/dist/cjs/gridview/gridviewComponent.d.ts +3 -3
  61. package/dist/cjs/gridview/gridviewPanel.d.ts +1 -1
  62. package/dist/cjs/index.d.ts +11 -4
  63. package/dist/cjs/index.js +14 -1
  64. package/dist/cjs/overlay/overlay.d.ts +43 -1
  65. package/dist/cjs/overlay/overlay.js +57 -8
  66. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
  67. package/dist/cjs/paneview/draggablePaneviewPanel.js +4 -4
  68. package/dist/cjs/paneview/paneviewComponent.d.ts +3 -3
  69. package/dist/cjs/paneview/paneviewComponent.js +5 -5
  70. package/dist/dockview-core.js +3199 -1251
  71. package/dist/dockview-core.min.js +2 -2
  72. package/dist/dockview-core.min.js.map +1 -1
  73. package/dist/dockview-core.min.noStyle.js +2 -2
  74. package/dist/dockview-core.min.noStyle.js.map +1 -1
  75. package/dist/dockview-core.noStyle.js +3198 -1250
  76. package/dist/esm/api/component.api.d.ts +42 -21
  77. package/dist/esm/api/component.api.js +63 -18
  78. package/dist/esm/api/dockviewGroupPanelApi.d.ts +23 -8
  79. package/dist/esm/api/dockviewGroupPanelApi.js +19 -0
  80. package/dist/esm/api/dockviewPanelApi.d.ts +4 -3
  81. package/dist/esm/api/dockviewPanelApi.js +7 -0
  82. package/dist/esm/dnd/droptarget.d.ts +8 -0
  83. package/dist/esm/dnd/droptarget.js +28 -0
  84. package/dist/esm/dockview/accessibilityMessages.d.ts +32 -0
  85. package/dist/esm/dockview/accessibilityMessages.js +30 -0
  86. package/dist/esm/dockview/allModules.d.ts +8 -0
  87. package/dist/esm/dockview/allModules.js +22 -0
  88. package/dist/esm/dockview/components/panel/content.d.ts +2 -0
  89. package/dist/esm/dockview/components/panel/content.js +36 -5
  90. package/dist/esm/dockview/components/tab/tab.js +33 -5
  91. package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +35 -0
  92. package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +65 -0
  93. package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +52 -0
  94. package/dist/esm/dockview/components/titlebar/groupDragSource.js +178 -0
  95. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
  96. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +31 -24
  97. package/dist/esm/dockview/components/titlebar/tabGroups.js +1 -0
  98. package/dist/esm/dockview/components/titlebar/tabs.d.ts +12 -0
  99. package/dist/esm/dockview/components/titlebar/tabs.js +102 -2
  100. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +4 -0
  101. package/dist/esm/dockview/components/titlebar/tabsContainer.js +8 -2
  102. package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -4
  103. package/dist/esm/dockview/components/titlebar/voidContainer.js +33 -145
  104. package/dist/esm/dockview/dockviewComponent.d.ts +299 -44
  105. package/dist/esm/dockview/dockviewComponent.js +1421 -717
  106. package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
  107. package/dist/esm/dockview/dockviewFloatingGroupPanel.js +35 -3
  108. package/dist/esm/dockview/dockviewGroupPanel.d.ts +0 -1
  109. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +36 -14
  110. package/dist/esm/dockview/dockviewGroupPanelModel.js +109 -93
  111. package/dist/esm/dockview/dockviewPanel.d.ts +2 -2
  112. package/dist/esm/dockview/edgeGroupService.d.ts +38 -0
  113. package/dist/esm/dockview/edgeGroupService.js +63 -0
  114. package/dist/esm/dockview/floatingGroupService.d.ts +37 -0
  115. package/dist/esm/dockview/floatingGroupService.js +150 -0
  116. package/dist/esm/dockview/headerActionsService.d.ts +32 -0
  117. package/dist/esm/dockview/headerActionsService.js +86 -0
  118. package/dist/esm/dockview/liveRegionService.d.ts +53 -0
  119. package/dist/esm/dockview/liveRegionService.js +159 -0
  120. package/dist/esm/dockview/moduleContracts.d.ts +119 -0
  121. package/dist/esm/dockview/moduleContracts.js +1 -0
  122. package/dist/esm/dockview/modules.d.ts +110 -0
  123. package/dist/esm/dockview/modules.js +170 -0
  124. package/dist/esm/dockview/options.d.ts +159 -6
  125. package/dist/esm/dockview/options.js +8 -1
  126. package/dist/esm/dockview/popoutWindowService.d.ts +95 -0
  127. package/dist/esm/dockview/popoutWindowService.js +175 -0
  128. package/dist/esm/dockview/rootDropTargetService.d.ts +35 -0
  129. package/dist/esm/dockview/rootDropTargetService.js +82 -0
  130. package/dist/esm/dockview/watermarkService.d.ts +30 -0
  131. package/dist/esm/dockview/watermarkService.js +56 -0
  132. package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
  133. package/dist/esm/gridview/baseComponentGridview.js +2 -2
  134. package/dist/esm/gridview/gridviewComponent.d.ts +3 -3
  135. package/dist/esm/gridview/gridviewPanel.d.ts +1 -1
  136. package/dist/esm/index.d.ts +11 -4
  137. package/dist/esm/index.js +4 -0
  138. package/dist/esm/overlay/overlay.d.ts +43 -1
  139. package/dist/esm/overlay/overlay.js +53 -8
  140. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
  141. package/dist/esm/paneview/draggablePaneviewPanel.js +4 -4
  142. package/dist/esm/paneview/paneviewComponent.d.ts +3 -3
  143. package/dist/esm/paneview/paneviewComponent.js +5 -5
  144. package/dist/package/main.cjs.js +3234 -1286
  145. package/dist/package/main.cjs.min.js +2 -2
  146. package/dist/package/main.esm.min.mjs +2 -2
  147. package/dist/package/main.esm.mjs +3189 -1252
  148. package/dist/styles/dockview.css +275 -13
  149. package/package.json +10 -1
  150. package/dist/cjs/dockview/contextMenu.d.ts +0 -10
  151. package/dist/cjs/dockview/contextMenu.js +0 -313
  152. package/dist/esm/dockview/contextMenu.d.ts +0 -10
  153. package/dist/esm/dockview/contextMenu.js +0 -228
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <h1>dockview-core</h1>
3
3
 
4
- <p>Framework-agnostic core layout engine — zero dependencies, vanilla TypeScript. Supports tabs, groups, grids and splitviews</p>
4
+ <p>Framework-agnostic core layout engine — zero dependencies, JavaScript. Supports tabs, groups, grids and splitviews</p>
5
5
 
6
6
  </div>
7
7
 
@@ -20,6 +20,13 @@
20
20
 
21
21
  Please see the website: https://dockview.dev
22
22
 
23
+ > **`dockview-core` is an internal package.** Install
24
+ > **[`dockview`](https://www.npmjs.com/package/dockview)** instead — the JavaScript
25
+ > JavaScript / TypeScript package that ships the full feature set out of the box. Using a
26
+ > framework? Install the bindings: [`dockview-react`](https://www.npmjs.com/package/dockview-react),
27
+ > [`dockview-vue`](https://www.npmjs.com/package/dockview-vue) or
28
+ > [`dockview-angular`](https://www.npmjs.com/package/dockview-angular).
29
+
23
30
  ## Features
24
31
 
25
32
  - Serialization / deserialization with full layout management
@@ -1,8 +1,8 @@
1
- import { DockviewMaximizedGroupChanged, FloatingGroupOptions, IDockviewComponent, MovePanelEvent, PopoutGroupChangePositionEvent, PopoutGroupChangeSizeEvent, SerializedDockview } from '../dockview/dockviewComponent';
1
+ import { DockviewActivePanelChangeEvent, DockviewLayoutMutationEvent, DockviewMaximizedGroupChangeEvent, DockviewPopoutGroupOptions, FloatingGroupOptions, GroupNavigationDirection, IDockviewComponent, MovePanelEvent, PopoutGroup, PopoutGroupChangePositionEvent, PopoutGroupChangeSizeEvent, SerializedDockview } from '../dockview/dockviewComponent';
2
2
  import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, DockviewDndOverlayEvent, MovementOptions } from '../dockview/options';
3
3
  import { Parameters } from '../panel/types';
4
4
  import { Direction } from '../gridview/baseComponentGridview';
5
- import { AddComponentOptions, IGridviewComponent, SerializedGridviewComponent } from '../gridview/gridviewComponent';
5
+ import { AddGridviewComponentOptions, IGridviewComponent, SerializedGridviewComponent } from '../gridview/gridviewComponent';
6
6
  import { IGridviewPanel } from '../gridview/gridviewPanel';
7
7
  import { AddPaneviewComponentOptions, SerializedPaneview, IPaneviewComponent } from '../paneview/paneviewComponent';
8
8
  import { IPaneviewPanel } from '../paneview/paneviewPanel';
@@ -14,7 +14,6 @@ import { Event } from '../events';
14
14
  import { IDockviewPanel } from '../dockview/dockviewPanel';
15
15
  import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
16
16
  import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/tabsContainer';
17
- import { Box } from '../types';
18
17
  import { DockviewDidDropEvent, DockviewWillDropEvent } from '../dockview/dockviewGroupPanelModel';
19
18
  import { DockviewWillShowOverlayLocationEvent, DockviewTabGroupChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewTabGroupPanelChangeEvent } from '../dockview/events';
20
19
  import { ITabGroup } from '../dockview/tabGroup';
@@ -170,7 +169,7 @@ export declare class PaneviewApi implements CommonApi<SerializedPaneview> {
170
169
  * Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
171
170
  */
172
171
  get onDidDrop(): Event<PaneviewDidDropEvent>;
173
- get onUnhandledDragOverEvent(): Event<PaneviewDndOverlayEvent>;
172
+ get onUnhandledDragOver(): Event<PaneviewDndOverlayEvent>;
174
173
  constructor(component: IPaneviewComponent);
175
174
  /**
176
175
  * Remove a panel given the panel object.
@@ -284,7 +283,7 @@ export declare class GridviewApi implements CommonApi<SerializedGridviewComponen
284
283
  /**
285
284
  * Add a panel and return the created object.
286
285
  */
287
- addPanel<T extends object = Parameters>(options: AddComponentOptions<T>): IGridviewPanel;
286
+ addPanel<T extends object = Parameters>(options: AddGridviewComponentOptions<T>): IGridviewPanel;
288
287
  /**
289
288
  * Remove a panel given the panel object.
290
289
  */
@@ -380,9 +379,11 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
380
379
  */
381
380
  get onDidRemoveGroup(): Event<DockviewGroupPanel>;
382
381
  /**
383
- * Invoked when the active panel changes. May be undefined if no panel is active.
382
+ * Invoked when the active panel changes. The event carries the active
383
+ * `panel` (may be undefined if no panel is active) and the
384
+ * {@link DockviewOrigin} (`'user'` vs `'api'`) of the change.
384
385
  */
385
- get onDidActivePanelChange(): Event<IDockviewPanel | undefined>;
386
+ get onDidActivePanelChange(): Event<DockviewActivePanelChangeEvent>;
386
387
  /**
387
388
  * Invoked when a panel is added. May be called multiple times when moving panels.
388
389
  */
@@ -411,6 +412,15 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
411
412
  * Preventing certain events may causes unexpected behaviours, use carefully.
412
413
  */
413
414
  get onWillDrop(): Event<DockviewWillDropEvent>;
415
+ /**
416
+ * Fires before each top-level structural layout mutation (add / remove /
417
+ * move / float / popout / maximize / load / clear). Compound operations
418
+ * (e.g. a drag) fire once. Pair with `onDidMutateLayout` to bracket a
419
+ * change — useful for undo/redo, autosave and dirty-tracking.
420
+ */
421
+ get onWillMutateLayout(): Event<DockviewLayoutMutationEvent>;
422
+ /** Fires after each top-level structural layout mutation. See `onWillMutateLayout`. */
423
+ get onDidMutateLayout(): Event<DockviewLayoutMutationEvent>;
414
424
  /**
415
425
  * Invoked before an overlay is shown indicating a drop target.
416
426
  *
@@ -431,10 +441,24 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
431
441
  * Calling `event.nativeEvent.preventDefault()` will prevent the panel drag starting.
432
442
  */
433
443
  get onWillDragPanel(): Event<TabDragEvent>;
434
- get onUnhandledDragOverEvent(): Event<DockviewDndOverlayEvent>;
444
+ get onUnhandledDragOver(): Event<DockviewDndOverlayEvent>;
435
445
  get onDidPopoutGroupSizeChange(): Event<PopoutGroupChangeSizeEvent>;
436
446
  get onDidPopoutGroupPositionChange(): Event<PopoutGroupChangePositionEvent>;
447
+ /**
448
+ * Fires when a popout group successfully opens in its own window, carrying
449
+ * the live `Window` handle. Use it to route focus or attach per-document
450
+ * listeners. Enumerate the current popouts at any time with `getPopouts()`.
451
+ */
452
+ get onDidAddPopoutGroup(): Event<PopoutGroup>;
453
+ /**
454
+ * Fires when a popout group is removed — whether the user closed its window
455
+ * or it was docked back programmatically. Symmetric with
456
+ * {@link onDidAddPopoutGroup}; not fired during component disposal.
457
+ */
458
+ get onDidRemovePopoutGroup(): Event<PopoutGroup>;
437
459
  get onDidOpenPopoutWindowFail(): Event<void>;
460
+ /** Enumerate the popout groups currently open in their own windows. */
461
+ getPopouts(): PopoutGroup[];
438
462
  /**
439
463
  * Invoked when a tab group is created in any group.
440
464
  */
@@ -467,6 +491,14 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
467
491
  * All group objects.
468
492
  */
469
493
  get groups(): DockviewGroupPanel[];
494
+ /**
495
+ * The nearest grid group in a spatial direction from `group`, comparing
496
+ * group centre points — e.g. the group visually to the left. Floating and
497
+ * popout groups are ignored. Returns `undefined` when there is no group in
498
+ * that direction. Pair with `group.api.boundingBox` to build your own
499
+ * spatial navigation.
500
+ */
501
+ adjacentGroupInDirection(group: IDockviewGroupPanel, direction: GroupNavigationDirection): IDockviewGroupPanel | undefined;
470
502
  /**
471
503
  * Active panel object.
472
504
  */
@@ -541,22 +573,11 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
541
573
  maximizeGroup(panel: IDockviewPanel): void;
542
574
  hasMaximizedGroup(): boolean;
543
575
  exitMaximizedGroup(): void;
544
- get onDidMaximizedGroupChange(): Event<DockviewMaximizedGroupChanged>;
576
+ get onDidMaximizedGroupChange(): Event<DockviewMaximizedGroupChangeEvent>;
545
577
  /**
546
578
  * Add a popout group in a new Window
547
579
  */
548
- addPopoutGroup(item: IDockviewPanel | DockviewGroupPanel, options?: {
549
- position?: Box;
550
- popoutUrl?: string;
551
- onDidOpen?: (event: {
552
- id: string;
553
- window: Window;
554
- }) => void;
555
- onWillClose?: (event: {
556
- id: string;
557
- window: Window;
558
- }) => void;
559
- }): Promise<boolean>;
580
+ addPopoutGroup(item: IDockviewPanel | DockviewGroupPanel, options?: DockviewPopoutGroupOptions): Promise<boolean>;
560
581
  /**
561
582
  * Add an edge group at the given position. Returns the group panel API
562
583
  * for the newly created group. Throws if a group already exists there.
@@ -288,9 +288,9 @@ var PaneviewApi = /** @class */ (function () {
288
288
  enumerable: false,
289
289
  configurable: true
290
290
  });
291
- Object.defineProperty(PaneviewApi.prototype, "onUnhandledDragOverEvent", {
291
+ Object.defineProperty(PaneviewApi.prototype, "onUnhandledDragOver", {
292
292
  get: function () {
293
- return this.component.onUnhandledDragOverEvent;
293
+ return this.component.onUnhandledDragOver;
294
294
  },
295
295
  enumerable: false,
296
296
  configurable: true
@@ -707,7 +707,9 @@ var DockviewApi = /** @class */ (function () {
707
707
  });
708
708
  Object.defineProperty(DockviewApi.prototype, "onDidActivePanelChange", {
709
709
  /**
710
- * Invoked when the active panel changes. May be undefined if no panel is active.
710
+ * Invoked when the active panel changes. The event carries the active
711
+ * `panel` (may be undefined if no panel is active) and the
712
+ * {@link DockviewOrigin} (`'user'` vs `'api'`) of the change.
711
713
  */
712
714
  get: function () {
713
715
  return this.component.onDidActivePanelChange;
@@ -785,6 +787,27 @@ var DockviewApi = /** @class */ (function () {
785
787
  enumerable: false,
786
788
  configurable: true
787
789
  });
790
+ Object.defineProperty(DockviewApi.prototype, "onWillMutateLayout", {
791
+ /**
792
+ * Fires before each top-level structural layout mutation (add / remove /
793
+ * move / float / popout / maximize / load / clear). Compound operations
794
+ * (e.g. a drag) fire once. Pair with `onDidMutateLayout` to bracket a
795
+ * change — useful for undo/redo, autosave and dirty-tracking.
796
+ */
797
+ get: function () {
798
+ return this.component.onWillMutateLayout;
799
+ },
800
+ enumerable: false,
801
+ configurable: true
802
+ });
803
+ Object.defineProperty(DockviewApi.prototype, "onDidMutateLayout", {
804
+ /** Fires after each top-level structural layout mutation. See `onWillMutateLayout`. */
805
+ get: function () {
806
+ return this.component.onDidMutateLayout;
807
+ },
808
+ enumerable: false,
809
+ configurable: true
810
+ });
788
811
  Object.defineProperty(DockviewApi.prototype, "onWillShowOverlay", {
789
812
  /**
790
813
  * Invoked before an overlay is shown indicating a drop target.
@@ -823,9 +846,9 @@ var DockviewApi = /** @class */ (function () {
823
846
  enumerable: false,
824
847
  configurable: true
825
848
  });
826
- Object.defineProperty(DockviewApi.prototype, "onUnhandledDragOverEvent", {
849
+ Object.defineProperty(DockviewApi.prototype, "onUnhandledDragOver", {
827
850
  get: function () {
828
- return this.component.onUnhandledDragOverEvent;
851
+ return this.component.onUnhandledDragOver;
829
852
  },
830
853
  enumerable: false,
831
854
  configurable: true
@@ -844,6 +867,30 @@ var DockviewApi = /** @class */ (function () {
844
867
  enumerable: false,
845
868
  configurable: true
846
869
  });
870
+ Object.defineProperty(DockviewApi.prototype, "onDidAddPopoutGroup", {
871
+ /**
872
+ * Fires when a popout group successfully opens in its own window, carrying
873
+ * the live `Window` handle. Use it to route focus or attach per-document
874
+ * listeners. Enumerate the current popouts at any time with `getPopouts()`.
875
+ */
876
+ get: function () {
877
+ return this.component.onDidAddPopoutGroup;
878
+ },
879
+ enumerable: false,
880
+ configurable: true
881
+ });
882
+ Object.defineProperty(DockviewApi.prototype, "onDidRemovePopoutGroup", {
883
+ /**
884
+ * Fires when a popout group is removed — whether the user closed its window
885
+ * or it was docked back programmatically. Symmetric with
886
+ * {@link onDidAddPopoutGroup}; not fired during component disposal.
887
+ */
888
+ get: function () {
889
+ return this.component.onDidRemovePopoutGroup;
890
+ },
891
+ enumerable: false,
892
+ configurable: true
893
+ });
847
894
  Object.defineProperty(DockviewApi.prototype, "onDidOpenPopoutWindowFail", {
848
895
  get: function () {
849
896
  return this.component.onDidOpenPopoutWindowFail;
@@ -851,6 +898,10 @@ var DockviewApi = /** @class */ (function () {
851
898
  enumerable: false,
852
899
  configurable: true
853
900
  });
901
+ /** Enumerate the popout groups currently open in their own windows. */
902
+ DockviewApi.prototype.getPopouts = function () {
903
+ return this.component.getPopouts();
904
+ };
854
905
  Object.defineProperty(DockviewApi.prototype, "onDidCreateTabGroup", {
855
906
  /**
856
907
  * Invoked when a tab group is created in any group.
@@ -931,6 +982,16 @@ var DockviewApi = /** @class */ (function () {
931
982
  enumerable: false,
932
983
  configurable: true
933
984
  });
985
+ /**
986
+ * The nearest grid group in a spatial direction from `group`, comparing
987
+ * group centre points — e.g. the group visually to the left. Floating and
988
+ * popout groups are ignored. Returns `undefined` when there is no group in
989
+ * that direction. Pair with `group.api.boundingBox` to build your own
990
+ * spatial navigation.
991
+ */
992
+ DockviewApi.prototype.adjacentGroupInDirection = function (group, direction) {
993
+ return this.component.adjacentGroupInDirection(group, direction);
994
+ };
934
995
  Object.defineProperty(DockviewApi.prototype, "activePanel", {
935
996
  /**
936
997
  * Active panel object.
@@ -974,13 +1035,19 @@ var DockviewApi = /** @class */ (function () {
974
1035
  * Add a panel and return the created object.
975
1036
  */
976
1037
  DockviewApi.prototype.addPanel = function (options) {
977
- return this.component.addPanel(options);
1038
+ var _this = this;
1039
+ return this.component.withOrigin('api', function () {
1040
+ return _this.component.addPanel(options);
1041
+ });
978
1042
  };
979
1043
  /**
980
1044
  * Remove a panel given the panel object.
981
1045
  */
982
1046
  DockviewApi.prototype.removePanel = function (panel) {
983
- this.component.removePanel(panel);
1047
+ var _this = this;
1048
+ this.component.withOrigin('api', function () {
1049
+ return _this.component.removePanel(panel);
1050
+ });
984
1051
  };
985
1052
  /**
986
1053
  * Add a group and return the created object.
@@ -992,13 +1059,19 @@ var DockviewApi = /** @class */ (function () {
992
1059
  * Close all groups and panels.
993
1060
  */
994
1061
  DockviewApi.prototype.closeAllGroups = function () {
995
- return this.component.closeAllGroups();
1062
+ var _this = this;
1063
+ return this.component.withOrigin('api', function () {
1064
+ return _this.component.closeAllGroups();
1065
+ });
996
1066
  };
997
1067
  /**
998
1068
  * Remove a group and any panels within the group.
999
1069
  */
1000
1070
  DockviewApi.prototype.removeGroup = function (group) {
1001
- this.component.removeGroup(group);
1071
+ var _this = this;
1072
+ this.component.withOrigin('api', function () {
1073
+ return _this.component.removeGroup(group);
1074
+ });
1002
1075
  };
1003
1076
  /**
1004
1077
  * Get a group object given a `string` id. May return undefined.
@@ -1010,13 +1083,19 @@ var DockviewApi = /** @class */ (function () {
1010
1083
  * Add a floating group
1011
1084
  */
1012
1085
  DockviewApi.prototype.addFloatingGroup = function (item, options) {
1013
- return this.component.addFloatingGroup(item, options);
1086
+ var _this = this;
1087
+ return this.component.withOrigin('api', function () {
1088
+ return _this.component.addFloatingGroup(item, options);
1089
+ });
1014
1090
  };
1015
1091
  /**
1016
1092
  * Create a component from a serialized object.
1017
1093
  */
1018
1094
  DockviewApi.prototype.fromJSON = function (data, options) {
1019
- this.component.fromJSON(data, options);
1095
+ var _this = this;
1096
+ this.component.withOrigin('api', function () {
1097
+ return _this.component.fromJSON(data, options);
1098
+ });
1020
1099
  };
1021
1100
  /**
1022
1101
  * Create a serialized object of the current component.
@@ -1028,7 +1107,8 @@ var DockviewApi = /** @class */ (function () {
1028
1107
  * Reset the component back to an empty and default state.
1029
1108
  */
1030
1109
  DockviewApi.prototype.clear = function () {
1031
- this.component.clear();
1110
+ var _this = this;
1111
+ this.component.withOrigin('api', function () { return _this.component.clear(); });
1032
1112
  };
1033
1113
  /**
1034
1114
  * Move the focus progmatically to the next panel or group.
@@ -1062,7 +1142,10 @@ var DockviewApi = /** @class */ (function () {
1062
1142
  * Add a popout group in a new Window
1063
1143
  */
1064
1144
  DockviewApi.prototype.addPopoutGroup = function (item, options) {
1065
- return this.component.addPopoutGroup(item, options);
1145
+ var _this = this;
1146
+ return this.component.withOrigin('api', function () {
1147
+ return _this.component.addPopoutGroup(item, options);
1148
+ });
1066
1149
  };
1067
1150
  /**
1068
1151
  * Add an edge group at the given position. Returns the group panel API
@@ -1110,23 +1193,31 @@ var DockviewApi = /** @class */ (function () {
1110
1193
  };
1111
1194
  DockviewApi.prototype.createTabGroup = function (options) {
1112
1195
  var model = this._getGroupModel(options.groupId);
1113
- return model.createTabGroup({
1114
- label: options.label,
1115
- color: options.color,
1116
- componentParams: options.componentParams,
1196
+ return this.component.withOrigin('api', function () {
1197
+ return model.createTabGroup({
1198
+ label: options.label,
1199
+ color: options.color,
1200
+ componentParams: options.componentParams,
1201
+ });
1117
1202
  });
1118
1203
  };
1119
1204
  DockviewApi.prototype.dissolveTabGroup = function (options) {
1120
1205
  var model = this._getGroupModel(options.groupId);
1121
- model.dissolveTabGroup(options.tabGroupId);
1206
+ this.component.withOrigin('api', function () {
1207
+ return model.dissolveTabGroup(options.tabGroupId);
1208
+ });
1122
1209
  };
1123
1210
  DockviewApi.prototype.addPanelToTabGroup = function (options) {
1124
1211
  var model = this._getGroupModel(options.groupId);
1125
- model.addPanelToTabGroup(options.tabGroupId, options.panelId, options.index);
1212
+ this.component.withOrigin('api', function () {
1213
+ return model.addPanelToTabGroup(options.tabGroupId, options.panelId, options.index);
1214
+ });
1126
1215
  };
1127
1216
  DockviewApi.prototype.removePanelFromTabGroup = function (options) {
1128
1217
  var model = this._getGroupModel(options.groupId);
1129
- model.removePanelFromTabGroup(options.panelId);
1218
+ this.component.withOrigin('api', function () {
1219
+ return model.removePanelFromTabGroup(options.panelId);
1220
+ });
1130
1221
  };
1131
1222
  DockviewApi.prototype.getTabGroups = function (options) {
1132
1223
  var model = this._getGroupModel(options.groupId);
@@ -1,7 +1,8 @@
1
1
  import { Position } from '../dnd/droptarget';
2
2
  import { DockviewComponent } from '../dockview/dockviewComponent';
3
+ import { Box } from '../types';
3
4
  import { DockviewGroupPanel } from '../dockview/dockviewGroupPanel';
4
- import { DockviewGroupChangeEvent, DockviewGroupLocation, DockviewGroupPanelLocked } from '../dockview/dockviewGroupPanelModel';
5
+ import { DockviewGroupActivePanelChangeEvent, DockviewGroupLocation, DockviewGroupPanelLocked } from '../dockview/dockviewGroupPanelModel';
5
6
  import { DockviewHeaderPosition } from '../dockview/options';
6
7
  import { Emitter, Event } from '../events';
7
8
  import { GridviewPanelApi, GridviewPanelApiImpl, SizeEvent } from './gridviewPanelApi';
@@ -21,8 +22,15 @@ export interface DockviewGroupPanelCollapsedChangeEvent {
21
22
  readonly isCollapsed: boolean;
22
23
  }
23
24
  export interface DockviewGroupPanelApi extends GridviewPanelApi {
24
- readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
25
- readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
25
+ readonly onDidLocationChange: Event<DockviewGroupPanelLocationChangeEvent>;
26
+ /**
27
+ * Fires when the active panel *within this group* changes. Scoped to the
28
+ * group, in contrast to the component-level
29
+ * `DockviewApi.onDidActivePanelChange` (which tracks the active panel across
30
+ * the whole dockview). Both carry an {@link DockviewOrigin} reporting
31
+ * whether the change came from a user gesture or an API call.
32
+ */
33
+ readonly onDidActivePanelChange: Event<DockviewGroupActivePanelChangeEvent>;
26
34
  /**
27
35
  * Fired when an edge group's collapsed state changes.
28
36
  * Never fires for non-edge groups.
@@ -61,20 +69,27 @@ export interface DockviewGroupPanelApi extends GridviewPanelApi {
61
69
  */
62
70
  isCollapsed(): boolean;
63
71
  }
64
- export interface DockviewGroupPanelFloatingChangeEvent {
72
+ export interface DockviewGroupPanelLocationChangeEvent {
65
73
  readonly location: DockviewGroupLocation;
66
74
  }
67
75
  export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
68
76
  private readonly accessor;
69
77
  private _group;
70
78
  private _pendingSize;
71
- readonly _onDidLocationChange: Emitter<DockviewGroupPanelFloatingChangeEvent>;
72
- readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
73
- readonly _onDidActivePanelChange: Emitter<DockviewGroupChangeEvent>;
74
- readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
79
+ readonly _onDidLocationChange: Emitter<DockviewGroupPanelLocationChangeEvent>;
80
+ readonly onDidLocationChange: Event<DockviewGroupPanelLocationChangeEvent>;
81
+ readonly _onDidActivePanelChange: Emitter<DockviewGroupActivePanelChangeEvent>;
82
+ readonly onDidActivePanelChange: Event<DockviewGroupActivePanelChangeEvent>;
75
83
  readonly _onDidCollapsedChange: Emitter<DockviewGroupPanelCollapsedChangeEvent>;
76
84
  readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>;
77
85
  get location(): DockviewGroupLocation;
86
+ /**
87
+ * The group's bounding box relative to the top-left of the dockview root,
88
+ * in pixels. Covers grid and floating groups; returns `undefined` for a
89
+ * popout group (it lives in a separate window). Reflects the live rendered
90
+ * geometry, so it is only meaningful once the layout has been sized.
91
+ */
92
+ get boundingBox(): Box | undefined;
78
93
  get locked(): DockviewGroupPanelLocked;
79
94
  set locked(value: DockviewGroupPanelLocked);
80
95
  constructor(id: string, accessor: DockviewComponent);
@@ -61,6 +61,29 @@ var DockviewGroupPanelApiImpl = /** @class */ (function (_super) {
61
61
  enumerable: false,
62
62
  configurable: true
63
63
  });
64
+ Object.defineProperty(DockviewGroupPanelApiImpl.prototype, "boundingBox", {
65
+ /**
66
+ * The group's bounding box relative to the top-left of the dockview root,
67
+ * in pixels. Covers grid and floating groups; returns `undefined` for a
68
+ * popout group (it lives in a separate window). Reflects the live rendered
69
+ * geometry, so it is only meaningful once the layout has been sized.
70
+ */
71
+ get: function () {
72
+ if (!this._group || this._group.model.location.type === 'popout') {
73
+ return undefined;
74
+ }
75
+ var root = this.accessor.element.getBoundingClientRect();
76
+ var rect = this._group.element.getBoundingClientRect();
77
+ return {
78
+ left: rect.left - root.left,
79
+ top: rect.top - root.top,
80
+ width: rect.width,
81
+ height: rect.height,
82
+ };
83
+ },
84
+ enumerable: false,
85
+ configurable: true
86
+ });
64
87
  Object.defineProperty(DockviewGroupPanelApiImpl.prototype, "locked", {
65
88
  get: function () {
66
89
  if (!this._group) {
@@ -4,7 +4,7 @@ import { DockviewGroupPanel } from '../dockview/dockviewGroupPanel';
4
4
  import { DockviewPanel } from '../dockview/dockviewPanel';
5
5
  import { DockviewComponent } from '../dockview/dockviewComponent';
6
6
  import { DockviewPanelRenderer } from '../overlay/overlayRenderContainer';
7
- import { DockviewGroupMoveParams, DockviewGroupPanelFloatingChangeEvent } from './dockviewGroupPanelApi';
7
+ import { DockviewGroupMoveParams, DockviewGroupPanelLocationChangeEvent } from './dockviewGroupPanelApi';
8
8
  import { DockviewGroupLocation } from '../dockview/dockviewGroupPanelModel';
9
9
  export interface TitleEvent {
10
10
  readonly title: string;
@@ -34,7 +34,7 @@ export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible' |
34
34
  readonly onDidTitleChange: Event<TitleEvent>;
35
35
  readonly onDidRendererChange: Event<RendererChangedEvent>;
36
36
  readonly location: DockviewGroupLocation;
37
- readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
37
+ readonly onDidLocationChange: Event<DockviewGroupPanelLocationChangeEvent>;
38
38
  close(): void;
39
39
  setTitle(title: string): void;
40
40
  setRenderer(renderer: DockviewPanelRenderer): void;
@@ -61,7 +61,7 @@ export declare class DockviewPanelApiImpl extends GridviewPanelApiImpl implement
61
61
  readonly _onDidRendererChange: Emitter<RendererChangedEvent>;
62
62
  readonly onDidRendererChange: Event<RendererChangedEvent>;
63
63
  private readonly _onDidLocationChange;
64
- readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
64
+ readonly onDidLocationChange: Event<DockviewGroupPanelLocationChangeEvent>;
65
65
  private readonly groupEventsDisposable;
66
66
  get location(): DockviewGroupLocation;
67
67
  get title(): string | undefined;
@@ -72,6 +72,7 @@ export declare class DockviewPanelApiImpl extends GridviewPanelApiImpl implement
72
72
  get tabComponent(): string | undefined;
73
73
  constructor(panel: DockviewPanel, group: DockviewGroupPanel, accessor: DockviewComponent, component: string, tabComponent?: string);
74
74
  getWindow(): Window;
75
+ setActive(): void;
75
76
  moveTo(options: DockviewPanelMoveParams): void;
76
77
  setTitle(title: string): void;
77
78
  setRenderer(renderer: DockviewPanelRenderer): void;
@@ -99,6 +99,14 @@ var DockviewPanelApiImpl = /** @class */ (function (_super) {
99
99
  DockviewPanelApiImpl.prototype.getWindow = function () {
100
100
  return this.group.api.getWindow();
101
101
  };
102
+ DockviewPanelApiImpl.prototype.setActive = function () {
103
+ var _this = this;
104
+ // A bare `panel.api.setActive()` from application code is a
105
+ // programmatic activation. Tag it `'api'` so `onDidActivePanelChange`
106
+ // reports the correct origin; user-gesture call sites that route
107
+ // through here wrap the call in `withOrigin('user')` first, which wins.
108
+ this.accessor.withOrigin('api', function () { return _super.prototype.setActive.call(_this); });
109
+ };
102
110
  DockviewPanelApiImpl.prototype.moveTo = function (options) {
103
111
  var _a, _b;
104
112
  this.accessor.moveGroupOrPanel({
@@ -103,6 +103,14 @@ export declare class Droptarget extends CompositeDisposable implements IDropTarg
103
103
  private toggleClasses;
104
104
  private calculateQuadrant;
105
105
  private removeDropTarget;
106
+ /**
107
+ * Render the drop overlay at `position` without a live drag, so keyboard
108
+ * docking shows the exact same preview as a mouse drag. Mirrors the
109
+ * `onDragOver` render path (in-place or anchored). Pair with `clearOverlay`.
110
+ */
111
+ showOverlay(position: Position): void;
112
+ /** Clear an overlay shown via {@link showOverlay} (in-place or anchored). */
113
+ clearOverlay(): void;
106
114
  }
107
115
  export declare function calculateQuadrantAsPercentage(overlayType: Set<Position>, x: number, y: number, width: number, height: number, threshold: number): Position | null;
108
116
  export declare function calculateQuadrantAsPixels(overlayType: Set<Position>, x: number, y: number, width: number, height: number, threshold: number): Position | null;
@@ -290,6 +290,34 @@ var Droptarget = /** @class */ (function (_super) {
290
290
  this.overlayElement = undefined;
291
291
  }
292
292
  };
293
+ /**
294
+ * Render the drop overlay at `position` without a live drag, so keyboard
295
+ * docking shows the exact same preview as a mouse drag. Mirrors the
296
+ * `onDragOver` render path (in-place or anchored). Pair with `clearOverlay`.
297
+ */
298
+ Droptarget.prototype.showOverlay = function (position) {
299
+ var _a, _b, _c, _d, _e;
300
+ var overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
301
+ var target = (_e = (_d = (_c = this.options).getOverlayOutline) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : this.element;
302
+ var width = target.offsetWidth;
303
+ var height = target.offsetHeight;
304
+ if (!overrideTarget && !this.targetElement) {
305
+ var els = (0, dropOverlay_1.createOverlayElements)();
306
+ this.targetElement = els.dropzone;
307
+ this.overlayElement = els.selection;
308
+ target.classList.add('dv-drop-target');
309
+ target.append(this.targetElement);
310
+ }
311
+ this.toggleClasses(position, width, height);
312
+ this._state = position;
313
+ };
314
+ /** Clear an overlay shown via {@link showOverlay} (in-place or anchored). */
315
+ Droptarget.prototype.clearOverlay = function () {
316
+ var _a, _b, _c;
317
+ this.removeDropTarget();
318
+ (_c = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.clear();
319
+ this._state = undefined;
320
+ };
293
321
  Droptarget.USED_EVENT_ID = '__dockview_droptarget_event_is_used__';
294
322
  return Droptarget;
295
323
  }(lifecycle_1.CompositeDisposable));
@@ -0,0 +1,32 @@
1
+ import { Position } from '../dnd/droptarget';
2
+ /**
3
+ * The full set of localisable strings dockview speaks to assistive technology:
4
+ * the LiveRegion announcements and the keyboard-docking narration. Each entry
5
+ * returns the complete sentence so a translator owns wording *and* word order.
6
+ *
7
+ * Override any subset via the `messages` option; unset entries keep the
8
+ * English defaults below. For fine-grained, per-event announcement overrides
9
+ * (with access to the panel) use `getAnnouncement`, which takes precedence.
10
+ */
11
+ export interface DockviewMessages {
12
+ panelOpened(title: string): string;
13
+ panelClosed(title: string): string;
14
+ groupMaximized(title: string): string;
15
+ groupRestored(title: string): string;
16
+ groupFloated(title: string): string;
17
+ groupDocked(title: string): string;
18
+ groupPoppedOut(title: string): string;
19
+ /** Target phase: which group is highlighted, and how to proceed. */
20
+ movePickTarget(source: string, target: string, current: number, total: number): string;
21
+ /** Edge phase: which drop position is selected, and how to proceed. */
22
+ movePickEdge(position: Position, target: string): string;
23
+ /** A move committed. */
24
+ moveCommitted(source: string, target: string, position: Position): string;
25
+ /** A move cancelled with Escape. */
26
+ moveCancelled(): string;
27
+ /** A move the layout rejected. */
28
+ moveNotAllowed(): string;
29
+ }
30
+ export declare const DEFAULT_MESSAGES: DockviewMessages;
31
+ /** Merge an app's partial overrides over the English defaults. */
32
+ export declare function resolveMessages(overrides?: Partial<DockviewMessages>): DockviewMessages;