dockview-core 5.1.0 → 6.0.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.
Files changed (117) hide show
  1. package/README.md +3 -1
  2. package/dist/cjs/api/component.api.d.ts +93 -1
  3. package/dist/cjs/api/component.api.js +146 -0
  4. package/dist/cjs/api/dockviewGroupPanelApi.d.ts +26 -0
  5. package/dist/cjs/api/dockviewGroupPanelApi.js +21 -1
  6. package/dist/cjs/api/entryPoints.js +4 -5
  7. package/dist/cjs/array.js +7 -8
  8. package/dist/cjs/dnd/dataTransfer.d.ts +2 -1
  9. package/dist/cjs/dnd/dataTransfer.js +5 -4
  10. package/dist/cjs/dnd/droptarget.d.ts +12 -0
  11. package/dist/cjs/dnd/droptarget.js +38 -10
  12. package/dist/cjs/dnd/ghost.js +1 -2
  13. package/dist/cjs/dockview/components/panel/content.js +5 -1
  14. package/dist/cjs/dockview/components/popupService.d.ts +9 -2
  15. package/dist/cjs/dockview/components/popupService.js +24 -9
  16. package/dist/cjs/dockview/components/tab/tab.d.ts +8 -1
  17. package/dist/cjs/dockview/components/tab/tab.js +94 -6
  18. package/dist/cjs/dockview/components/titlebar/tabGroupChip.d.ts +30 -0
  19. package/dist/cjs/dockview/components/titlebar/tabGroupChip.js +95 -0
  20. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +71 -0
  21. package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +471 -0
  22. package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +57 -0
  23. package/dist/cjs/dockview/components/titlebar/tabGroups.js +612 -0
  24. package/dist/cjs/dockview/components/titlebar/tabOverflowControl.js +1 -2
  25. package/dist/cjs/dockview/components/titlebar/tabs.d.ts +67 -0
  26. package/dist/cjs/dockview/components/titlebar/tabs.js +1464 -34
  27. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +6 -0
  28. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +132 -14
  29. package/dist/cjs/dockview/contextMenu.d.ts +10 -0
  30. package/dist/cjs/dockview/contextMenu.js +298 -0
  31. package/dist/cjs/dockview/dockviewComponent.d.ts +60 -3
  32. package/dist/cjs/dockview/dockviewComponent.js +712 -126
  33. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +83 -0
  34. package/dist/cjs/dockview/dockviewGroupPanelModel.js +619 -27
  35. package/dist/cjs/dockview/dockviewShell.d.ts +128 -0
  36. package/dist/cjs/dockview/dockviewShell.js +681 -0
  37. package/dist/cjs/dockview/events.d.ts +9 -0
  38. package/dist/cjs/dockview/framework.d.ts +14 -0
  39. package/dist/cjs/dockview/options.d.ts +97 -2
  40. package/dist/cjs/dockview/options.js +10 -5
  41. package/dist/cjs/dockview/tabGroup.d.ts +99 -0
  42. package/dist/cjs/dockview/tabGroup.js +219 -0
  43. package/dist/cjs/dockview/tabGroupAccent.d.ts +65 -0
  44. package/dist/cjs/dockview/tabGroupAccent.js +128 -0
  45. package/dist/cjs/dockview/theme.d.ts +56 -1
  46. package/dist/cjs/dockview/theme.js +103 -6
  47. package/dist/cjs/dockview/types.d.ts +2 -0
  48. package/dist/cjs/dom.js +19 -19
  49. package/dist/cjs/events.js +2 -2
  50. package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -0
  51. package/dist/cjs/gridview/baseComponentGridview.js +6 -3
  52. package/dist/cjs/gridview/gridview.js +7 -7
  53. package/dist/cjs/index.d.ts +8 -5
  54. package/dist/cjs/index.js +6 -1
  55. package/dist/cjs/popoutWindow.js +3 -3
  56. package/dist/cjs/splitview/splitviewPanel.d.ts +1 -1
  57. package/dist/dockview-core.js +5188 -729
  58. package/dist/dockview-core.min.js +2 -2
  59. package/dist/dockview-core.min.js.map +1 -1
  60. package/dist/dockview-core.min.noStyle.js +2 -2
  61. package/dist/dockview-core.min.noStyle.js.map +1 -1
  62. package/dist/dockview-core.noStyle.js +5186 -727
  63. package/dist/esm/api/component.api.d.ts +93 -1
  64. package/dist/esm/api/component.api.js +118 -0
  65. package/dist/esm/api/dockviewGroupPanelApi.d.ts +26 -0
  66. package/dist/esm/api/dockviewGroupPanelApi.js +21 -1
  67. package/dist/esm/dnd/dataTransfer.d.ts +2 -1
  68. package/dist/esm/dnd/dataTransfer.js +2 -1
  69. package/dist/esm/dnd/droptarget.d.ts +12 -0
  70. package/dist/esm/dnd/droptarget.js +33 -5
  71. package/dist/esm/dockview/components/panel/content.js +5 -1
  72. package/dist/esm/dockview/components/popupService.d.ts +9 -2
  73. package/dist/esm/dockview/components/popupService.js +23 -9
  74. package/dist/esm/dockview/components/tab/tab.d.ts +8 -1
  75. package/dist/esm/dockview/components/tab/tab.js +96 -6
  76. package/dist/esm/dockview/components/titlebar/tabGroupChip.d.ts +30 -0
  77. package/dist/esm/dockview/components/titlebar/tabGroupChip.js +68 -0
  78. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +71 -0
  79. package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +354 -0
  80. package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +57 -0
  81. package/dist/esm/dockview/components/titlebar/tabGroups.js +406 -0
  82. package/dist/esm/dockview/components/titlebar/tabs.d.ts +67 -0
  83. package/dist/esm/dockview/components/titlebar/tabs.js +1212 -25
  84. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +6 -0
  85. package/dist/esm/dockview/components/titlebar/tabsContainer.js +105 -7
  86. package/dist/esm/dockview/contextMenu.d.ts +10 -0
  87. package/dist/esm/dockview/contextMenu.js +213 -0
  88. package/dist/esm/dockview/dockviewComponent.d.ts +60 -3
  89. package/dist/esm/dockview/dockviewComponent.js +460 -35
  90. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +83 -0
  91. package/dist/esm/dockview/dockviewGroupPanelModel.js +460 -4
  92. package/dist/esm/dockview/dockviewShell.d.ts +128 -0
  93. package/dist/esm/dockview/dockviewShell.js +621 -0
  94. package/dist/esm/dockview/events.d.ts +9 -0
  95. package/dist/esm/dockview/framework.d.ts +14 -0
  96. package/dist/esm/dockview/options.d.ts +97 -2
  97. package/dist/esm/dockview/options.js +5 -0
  98. package/dist/esm/dockview/tabGroup.d.ts +99 -0
  99. package/dist/esm/dockview/tabGroup.js +144 -0
  100. package/dist/esm/dockview/tabGroupAccent.d.ts +65 -0
  101. package/dist/esm/dockview/tabGroupAccent.js +116 -0
  102. package/dist/esm/dockview/theme.d.ts +56 -1
  103. package/dist/esm/dockview/theme.js +102 -5
  104. package/dist/esm/dockview/types.d.ts +2 -0
  105. package/dist/esm/dom.js +1 -1
  106. package/dist/esm/gridview/baseComponentGridview.d.ts +1 -0
  107. package/dist/esm/gridview/baseComponentGridview.js +4 -1
  108. package/dist/esm/index.d.ts +8 -5
  109. package/dist/esm/index.js +2 -1
  110. package/dist/esm/popoutWindow.js +1 -1
  111. package/dist/esm/splitview/splitviewPanel.d.ts +1 -1
  112. package/dist/package/main.cjs.js +5182 -753
  113. package/dist/package/main.cjs.min.js +2 -2
  114. package/dist/package/main.esm.min.mjs +2 -2
  115. package/dist/package/main.esm.mjs +5168 -753
  116. package/dist/styles/dockview.css +1968 -195
  117. package/package.json +5 -1
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ##
18
18
 
19
- ![](https://github.com/mathuo/dockview/blob/HEAD/packages/docs/static/img/splashscreen.gif?raw=true)
19
+ ![](https://github.com/mathuo/dockview/blob/HEAD/packages/docs/static/img/splashscreenv2.png?raw=true)
20
20
 
21
21
  Please see the website: https://dockview.dev
22
22
 
@@ -28,6 +28,8 @@ Please see the website: https://dockview.dev
28
28
  - Tab and Group docking / Drag n' Drop
29
29
  - Popout Windows
30
30
  - Floating Groups
31
+ - Edge Groups
32
+ - Tab Groups
31
33
  - Extensive API
32
34
  - Supports Shadow DOMs
33
35
  - High test coverage
@@ -16,10 +16,14 @@ import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
16
16
  import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/tabsContainer';
17
17
  import { Box } from '../types';
18
18
  import { DockviewDidDropEvent, DockviewWillDropEvent } from '../dockview/dockviewGroupPanelModel';
19
- import { DockviewWillShowOverlayLocationEvent } from '../dockview/events';
19
+ import { DockviewWillShowOverlayLocationEvent, DockviewTabGroupChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewTabGroupPanelChangeEvent } from '../dockview/events';
20
+ import { ITabGroup } from '../dockview/tabGroup';
21
+ import { DockviewTabGroupColorEntry } from '../dockview/tabGroupAccent';
20
22
  import { PaneviewComponentOptions, PaneviewDndOverlayEvent } from '../paneview/options';
21
23
  import { SplitviewComponentOptions } from '../splitview/options';
22
24
  import { GridviewComponentOptions } from '../gridview/options';
25
+ import { EdgeGroupPosition, EdgeGroupOptions } from '../dockview/dockviewShell';
26
+ import { DockviewGroupPanelApi } from './dockviewGroupPanelApi';
23
27
  export interface CommonApi<T = any> {
24
28
  readonly height: number;
25
29
  readonly width: number;
@@ -315,6 +319,9 @@ export declare class GridviewApi implements CommonApi<SerializedGridviewComponen
315
319
  */
316
320
  dispose(): void;
317
321
  }
322
+ export interface DockviewGetTabGroupsOptions {
323
+ groupId: string;
324
+ }
318
325
  export declare class DockviewApi implements CommonApi<SerializedDockview> {
319
326
  private readonly component;
320
327
  /**
@@ -349,6 +356,13 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
349
356
  * Total number of groups.
350
357
  */
351
358
  get size(): number;
359
+ /**
360
+ * The active tab-group color palette. Reflects the configured
361
+ * `tabGroupColors` option, or the built-in defaults when unset.
362
+ * Useful for custom chip renderers that want to roll their own
363
+ * picker UI.
364
+ */
365
+ get tabGroupColors(): readonly DockviewTabGroupColorEntry[];
352
366
  /**
353
367
  * Total number of panels.
354
368
  */
@@ -421,6 +435,30 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
421
435
  get onDidPopoutGroupSizeChange(): Event<PopoutGroupChangeSizeEvent>;
422
436
  get onDidPopoutGroupPositionChange(): Event<PopoutGroupChangePositionEvent>;
423
437
  get onDidOpenPopoutWindowFail(): Event<void>;
438
+ /**
439
+ * Invoked when a tab group is created in any group.
440
+ */
441
+ get onDidCreateTabGroup(): Event<DockviewTabGroupChangeEvent>;
442
+ /**
443
+ * Invoked when a tab group is destroyed in any group.
444
+ */
445
+ get onDidDestroyTabGroup(): Event<DockviewTabGroupChangeEvent>;
446
+ /**
447
+ * Invoked when a panel is added to a tab group.
448
+ */
449
+ get onDidAddPanelToTabGroup(): Event<DockviewTabGroupPanelChangeEvent>;
450
+ /**
451
+ * Invoked when a panel is removed from a tab group.
452
+ */
453
+ get onDidRemovePanelFromTabGroup(): Event<DockviewTabGroupPanelChangeEvent>;
454
+ /**
455
+ * Invoked when a tab group's properties (label, color) change.
456
+ */
457
+ get onDidTabGroupChange(): Event<DockviewTabGroupChangeEvent>;
458
+ /**
459
+ * Invoked when a tab group is collapsed or expanded.
460
+ */
461
+ get onDidTabGroupCollapsedChange(): Event<DockviewTabGroupCollapsedChangeEvent>;
424
462
  /**
425
463
  * All panel objects.
426
464
  */
@@ -519,7 +557,61 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
519
557
  window: Window;
520
558
  }) => void;
521
559
  }): Promise<boolean>;
560
+ /**
561
+ * Add an edge group at the given position. Returns the group panel API
562
+ * for the newly created group. Throws if a group already exists there.
563
+ */
564
+ addEdgeGroup(position: EdgeGroupPosition, options: EdgeGroupOptions): DockviewGroupPanelApi;
565
+ /**
566
+ * Get the group panel API for an edge group at the given position.
567
+ * Returns `undefined` if no edge group is configured at that position.
568
+ */
569
+ getEdgeGroup(position: EdgeGroupPosition): DockviewGroupPanelApi | undefined;
570
+ /**
571
+ * Set the visibility of an edge group.
572
+ */
573
+ setEdgeGroupVisible(position: EdgeGroupPosition, visible: boolean): void;
574
+ /**
575
+ * Check whether an edge group is currently visible.
576
+ */
577
+ isEdgeGroupVisible(position: EdgeGroupPosition): boolean;
578
+ /**
579
+ * Remove an edge group and reclaim its slot in the layout.
580
+ * All panels inside the group are disposed. Throws if no group exists at position.
581
+ */
582
+ removeEdgeGroup(position: EdgeGroupPosition): void;
522
583
  updateOptions(options: Partial<DockviewComponentOptions>): void;
584
+ private _getGroupModel;
585
+ createTabGroup(options: {
586
+ groupId: string;
587
+ label?: string;
588
+ color?: string;
589
+ componentParams?: Record<string, unknown>;
590
+ }): ITabGroup;
591
+ dissolveTabGroup(options: {
592
+ groupId: string;
593
+ tabGroupId: string;
594
+ }): void;
595
+ addPanelToTabGroup(options: {
596
+ groupId: string;
597
+ tabGroupId: string;
598
+ panelId: string;
599
+ index?: number;
600
+ }): void;
601
+ removePanelFromTabGroup(options: {
602
+ groupId: string;
603
+ panelId: string;
604
+ }): void;
605
+ getTabGroups(options: DockviewGetTabGroupsOptions): readonly ITabGroup[];
606
+ getTabGroupForPanel(options: {
607
+ groupId: string;
608
+ panelId: string;
609
+ }): ITabGroup | undefined;
610
+ moveTabGroup(options: {
611
+ groupId: string;
612
+ tabGroupId: string;
613
+ index: number;
614
+ }): void;
523
615
  /**
524
616
  * Release resources and teardown component. Do not call when using framework versions of dockview.
525
617
  */
@@ -652,6 +652,19 @@ var DockviewApi = /** @class */ (function () {
652
652
  enumerable: false,
653
653
  configurable: true
654
654
  });
655
+ Object.defineProperty(DockviewApi.prototype, "tabGroupColors", {
656
+ /**
657
+ * The active tab-group color palette. Reflects the configured
658
+ * `tabGroupColors` option, or the built-in defaults when unset.
659
+ * Useful for custom chip renderers that want to roll their own
660
+ * picker UI.
661
+ */
662
+ get: function () {
663
+ return this.component.tabGroupColorPalette.entries();
664
+ },
665
+ enumerable: false,
666
+ configurable: true
667
+ });
655
668
  Object.defineProperty(DockviewApi.prototype, "totalPanels", {
656
669
  /**
657
670
  * Total number of panels.
@@ -838,6 +851,66 @@ var DockviewApi = /** @class */ (function () {
838
851
  enumerable: false,
839
852
  configurable: true
840
853
  });
854
+ Object.defineProperty(DockviewApi.prototype, "onDidCreateTabGroup", {
855
+ /**
856
+ * Invoked when a tab group is created in any group.
857
+ */
858
+ get: function () {
859
+ return this.component.onDidCreateTabGroup;
860
+ },
861
+ enumerable: false,
862
+ configurable: true
863
+ });
864
+ Object.defineProperty(DockviewApi.prototype, "onDidDestroyTabGroup", {
865
+ /**
866
+ * Invoked when a tab group is destroyed in any group.
867
+ */
868
+ get: function () {
869
+ return this.component.onDidDestroyTabGroup;
870
+ },
871
+ enumerable: false,
872
+ configurable: true
873
+ });
874
+ Object.defineProperty(DockviewApi.prototype, "onDidAddPanelToTabGroup", {
875
+ /**
876
+ * Invoked when a panel is added to a tab group.
877
+ */
878
+ get: function () {
879
+ return this.component.onDidAddPanelToTabGroup;
880
+ },
881
+ enumerable: false,
882
+ configurable: true
883
+ });
884
+ Object.defineProperty(DockviewApi.prototype, "onDidRemovePanelFromTabGroup", {
885
+ /**
886
+ * Invoked when a panel is removed from a tab group.
887
+ */
888
+ get: function () {
889
+ return this.component.onDidRemovePanelFromTabGroup;
890
+ },
891
+ enumerable: false,
892
+ configurable: true
893
+ });
894
+ Object.defineProperty(DockviewApi.prototype, "onDidTabGroupChange", {
895
+ /**
896
+ * Invoked when a tab group's properties (label, color) change.
897
+ */
898
+ get: function () {
899
+ return this.component.onDidTabGroupChange;
900
+ },
901
+ enumerable: false,
902
+ configurable: true
903
+ });
904
+ Object.defineProperty(DockviewApi.prototype, "onDidTabGroupCollapsedChange", {
905
+ /**
906
+ * Invoked when a tab group is collapsed or expanded.
907
+ */
908
+ get: function () {
909
+ return this.component.onDidTabGroupCollapsedChange;
910
+ },
911
+ enumerable: false,
912
+ configurable: true
913
+ });
841
914
  Object.defineProperty(DockviewApi.prototype, "panels", {
842
915
  /**
843
916
  * All panel objects.
@@ -991,9 +1064,82 @@ var DockviewApi = /** @class */ (function () {
991
1064
  DockviewApi.prototype.addPopoutGroup = function (item, options) {
992
1065
  return this.component.addPopoutGroup(item, options);
993
1066
  };
1067
+ /**
1068
+ * Add an edge group at the given position. Returns the group panel API
1069
+ * for the newly created group. Throws if a group already exists there.
1070
+ */
1071
+ DockviewApi.prototype.addEdgeGroup = function (position, options) {
1072
+ return this.component.addEdgeGroup(position, options);
1073
+ };
1074
+ /**
1075
+ * Get the group panel API for an edge group at the given position.
1076
+ * Returns `undefined` if no edge group is configured at that position.
1077
+ */
1078
+ DockviewApi.prototype.getEdgeGroup = function (position) {
1079
+ return this.component.getEdgeGroup(position);
1080
+ };
1081
+ /**
1082
+ * Set the visibility of an edge group.
1083
+ */
1084
+ DockviewApi.prototype.setEdgeGroupVisible = function (position, visible) {
1085
+ this.component.setEdgeGroupVisible(position, visible);
1086
+ };
1087
+ /**
1088
+ * Check whether an edge group is currently visible.
1089
+ */
1090
+ DockviewApi.prototype.isEdgeGroupVisible = function (position) {
1091
+ return this.component.isEdgeGroupVisible(position);
1092
+ };
1093
+ /**
1094
+ * Remove an edge group and reclaim its slot in the layout.
1095
+ * All panels inside the group are disposed. Throws if no group exists at position.
1096
+ */
1097
+ DockviewApi.prototype.removeEdgeGroup = function (position) {
1098
+ this.component.removeEdgeGroup(position);
1099
+ };
994
1100
  DockviewApi.prototype.updateOptions = function (options) {
995
1101
  this.component.updateOptions(options);
996
1102
  };
1103
+ // === Tab Group API ===
1104
+ DockviewApi.prototype._getGroupModel = function (groupId) {
1105
+ var group = this.component.getPanel(groupId);
1106
+ if (!group) {
1107
+ throw new Error("dockview: group '".concat(groupId, "' not found"));
1108
+ }
1109
+ return group.model;
1110
+ };
1111
+ DockviewApi.prototype.createTabGroup = function (options) {
1112
+ var model = this._getGroupModel(options.groupId);
1113
+ return model.createTabGroup({
1114
+ label: options.label,
1115
+ color: options.color,
1116
+ componentParams: options.componentParams,
1117
+ });
1118
+ };
1119
+ DockviewApi.prototype.dissolveTabGroup = function (options) {
1120
+ var model = this._getGroupModel(options.groupId);
1121
+ model.dissolveTabGroup(options.tabGroupId);
1122
+ };
1123
+ DockviewApi.prototype.addPanelToTabGroup = function (options) {
1124
+ var model = this._getGroupModel(options.groupId);
1125
+ model.addPanelToTabGroup(options.tabGroupId, options.panelId, options.index);
1126
+ };
1127
+ DockviewApi.prototype.removePanelFromTabGroup = function (options) {
1128
+ var model = this._getGroupModel(options.groupId);
1129
+ model.removePanelFromTabGroup(options.panelId);
1130
+ };
1131
+ DockviewApi.prototype.getTabGroups = function (options) {
1132
+ var model = this._getGroupModel(options.groupId);
1133
+ return model.getTabGroups();
1134
+ };
1135
+ DockviewApi.prototype.getTabGroupForPanel = function (options) {
1136
+ var model = this._getGroupModel(options.groupId);
1137
+ return model.getTabGroupForPanel(options.panelId);
1138
+ };
1139
+ DockviewApi.prototype.moveTabGroup = function (options) {
1140
+ var model = this._getGroupModel(options.groupId);
1141
+ model.moveTabGroup(options.tabGroupId, options.index);
1142
+ };
997
1143
  /**
998
1144
  * Release resources and teardown component. Do not call when using framework versions of dockview.
999
1145
  */
@@ -17,9 +17,17 @@ export interface DockviewGroupMoveParams {
17
17
  */
18
18
  skipSetActive?: boolean;
19
19
  }
20
+ export interface DockviewGroupPanelCollapsedChangeEvent {
21
+ readonly isCollapsed: boolean;
22
+ }
20
23
  export interface DockviewGroupPanelApi extends GridviewPanelApi {
21
24
  readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
22
25
  readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
26
+ /**
27
+ * Fired when an edge group's collapsed state changes.
28
+ * Never fires for non-edge groups.
29
+ */
30
+ readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>;
23
31
  readonly location: DockviewGroupLocation;
24
32
  /**
25
33
  * If you require the Window object
@@ -32,6 +40,19 @@ export interface DockviewGroupPanelApi extends GridviewPanelApi {
32
40
  isMaximized(): boolean;
33
41
  exitMaximized(): void;
34
42
  close(): void;
43
+ /**
44
+ * Collapse this group (edge groups only). No-op for non-edge groups.
45
+ */
46
+ collapse(): void;
47
+ /**
48
+ * Expand this group (edge groups only). No-op for non-edge groups.
49
+ */
50
+ expand(): void;
51
+ /**
52
+ * Returns true if this edge group is currently collapsed.
53
+ * Always returns false for non-edge groups.
54
+ */
55
+ isCollapsed(): boolean;
35
56
  }
36
57
  export interface DockviewGroupPanelFloatingChangeEvent {
37
58
  readonly location: DockviewGroupLocation;
@@ -44,6 +65,8 @@ export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
44
65
  readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
45
66
  readonly _onDidActivePanelChange: Emitter<DockviewGroupChangeEvent>;
46
67
  readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
68
+ readonly _onDidCollapsedChange: Emitter<DockviewGroupPanelCollapsedChangeEvent>;
69
+ readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>;
47
70
  get location(): DockviewGroupLocation;
48
71
  constructor(id: string, accessor: DockviewComponent);
49
72
  setSize(event: SizeEvent): void;
@@ -55,5 +78,8 @@ export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
55
78
  maximize(): void;
56
79
  isMaximized(): boolean;
57
80
  exitMaximized(): void;
81
+ collapse(): void;
82
+ expand(): void;
83
+ isCollapsed(): boolean;
58
84
  initialize(group: DockviewGroupPanel): void;
59
85
  }
@@ -40,7 +40,9 @@ var DockviewGroupPanelApiImpl = /** @class */ (function (_super) {
40
40
  _this.onDidLocationChange = _this._onDidLocationChange.event;
41
41
  _this._onDidActivePanelChange = new events_1.Emitter();
42
42
  _this.onDidActivePanelChange = _this._onDidActivePanelChange.event;
43
- _this.addDisposables(_this._onDidLocationChange, _this._onDidActivePanelChange, _this._onDidVisibilityChange.event(function (event) {
43
+ _this._onDidCollapsedChange = new events_1.Emitter();
44
+ _this.onDidCollapsedChange = _this._onDidCollapsedChange.event;
45
+ _this.addDisposables(_this._onDidLocationChange, _this._onDidActivePanelChange, _this._onDidCollapsedChange, _this._onDidVisibilityChange.event(function (event) {
44
46
  // When becoming visible, apply any pending size change
45
47
  if (event.isVisible && _this._pendingSize) {
46
48
  _super.prototype.setSize.call(_this, _this._pendingSize);
@@ -133,6 +135,24 @@ var DockviewGroupPanelApiImpl = /** @class */ (function (_super) {
133
135
  this.accessor.exitMaximizedGroup();
134
136
  }
135
137
  };
138
+ DockviewGroupPanelApiImpl.prototype.collapse = function () {
139
+ if (!this._group) {
140
+ return;
141
+ }
142
+ this.accessor.setEdgeGroupCollapsed(this._group, true);
143
+ };
144
+ DockviewGroupPanelApiImpl.prototype.expand = function () {
145
+ if (!this._group) {
146
+ return;
147
+ }
148
+ this.accessor.setEdgeGroupCollapsed(this._group, false);
149
+ };
150
+ DockviewGroupPanelApiImpl.prototype.isCollapsed = function () {
151
+ if (!this._group) {
152
+ return false;
153
+ }
154
+ return this.accessor.isEdgeGroupCollapsed(this._group);
155
+ };
136
156
  DockviewGroupPanelApiImpl.prototype.initialize = function (group) {
137
157
  this._group = group;
138
158
  };
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPaneview = exports.createGridview = exports.createSplitview = exports.createDockview = void 0;
3
+ exports.createDockview = createDockview;
4
+ exports.createSplitview = createSplitview;
5
+ exports.createGridview = createGridview;
6
+ exports.createPaneview = createPaneview;
4
7
  var component_api_1 = require("../api/component.api");
5
8
  var dockviewComponent_1 = require("../dockview/dockviewComponent");
6
9
  var gridviewComponent_1 = require("../gridview/gridviewComponent");
@@ -10,19 +13,15 @@ function createDockview(element, options) {
10
13
  var component = new dockviewComponent_1.DockviewComponent(element, options);
11
14
  return component.api;
12
15
  }
13
- exports.createDockview = createDockview;
14
16
  function createSplitview(element, options) {
15
17
  var component = new splitviewComponent_1.SplitviewComponent(element, options);
16
18
  return new component_api_1.SplitviewApi(component);
17
19
  }
18
- exports.createSplitview = createSplitview;
19
20
  function createGridview(element, options) {
20
21
  var component = new gridviewComponent_1.GridviewComponent(element, options);
21
22
  return new component_api_1.GridviewApi(component);
22
23
  }
23
- exports.createGridview = createGridview;
24
24
  function createPaneview(element, options) {
25
25
  var component = new paneviewComponent_1.PaneviewComponent(element, options);
26
26
  return new component_api_1.PaneviewApi(component);
27
27
  }
28
- exports.createPaneview = createPaneview;
package/dist/cjs/array.js CHANGED
@@ -1,17 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.remove = exports.firstIndex = exports.pushToEnd = exports.pushToStart = exports.sequenceEquals = exports.last = exports.tail = void 0;
3
+ exports.tail = tail;
4
+ exports.last = last;
5
+ exports.sequenceEquals = sequenceEquals;
6
+ exports.pushToStart = pushToStart;
7
+ exports.pushToEnd = pushToEnd;
8
+ exports.firstIndex = firstIndex;
9
+ exports.remove = remove;
4
10
  function tail(arr) {
5
11
  if (arr.length === 0) {
6
12
  throw new Error('Invalid tail call');
7
13
  }
8
14
  return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];
9
15
  }
10
- exports.tail = tail;
11
16
  function last(arr) {
12
17
  return arr.length > 0 ? arr[arr.length - 1] : undefined;
13
18
  }
14
- exports.last = last;
15
19
  function sequenceEquals(arr1, arr2) {
16
20
  if (arr1.length !== arr2.length) {
17
21
  return false;
@@ -23,7 +27,6 @@ function sequenceEquals(arr1, arr2) {
23
27
  }
24
28
  return true;
25
29
  }
26
- exports.sequenceEquals = sequenceEquals;
27
30
  /**
28
31
  * Pushes an element to the start of the array, if found.
29
32
  */
@@ -34,7 +37,6 @@ function pushToStart(arr, value) {
34
37
  arr.unshift(value);
35
38
  }
36
39
  }
37
- exports.pushToStart = pushToStart;
38
40
  /**
39
41
  * Pushes an element to the end of the array, if found.
40
42
  */
@@ -45,7 +47,6 @@ function pushToEnd(arr, value) {
45
47
  arr.push(value);
46
48
  }
47
49
  }
48
- exports.pushToEnd = pushToEnd;
49
50
  function firstIndex(array, fn) {
50
51
  for (var i = 0; i < array.length; i++) {
51
52
  var element = array[i];
@@ -55,7 +56,6 @@ function firstIndex(array, fn) {
55
56
  }
56
57
  return -1;
57
58
  }
58
- exports.firstIndex = firstIndex;
59
59
  function remove(array, value) {
60
60
  var index = array.findIndex(function (t) { return t === value; });
61
61
  if (index > -1) {
@@ -64,4 +64,3 @@ function remove(array, value) {
64
64
  }
65
65
  return false;
66
66
  }
67
- exports.remove = remove;
@@ -4,7 +4,8 @@ export declare class PanelTransfer extends TransferObject {
4
4
  readonly viewId: string;
5
5
  readonly groupId: string;
6
6
  readonly panelId: string | null;
7
- constructor(viewId: string, groupId: string, panelId: string | null);
7
+ readonly tabGroupId?: string | undefined;
8
+ constructor(viewId: string, groupId: string, panelId: string | null, tabGroupId?: string | undefined);
8
9
  }
9
10
  export declare class PaneTransfer extends TransferObject {
10
11
  readonly viewId: string;
@@ -15,7 +15,9 @@ var __extends = (this && this.__extends) || (function () {
15
15
  };
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.getPaneData = exports.getPanelData = exports.LocalSelectionTransfer = exports.PaneTransfer = exports.PanelTransfer = void 0;
18
+ exports.LocalSelectionTransfer = exports.PaneTransfer = exports.PanelTransfer = void 0;
19
+ exports.getPanelData = getPanelData;
20
+ exports.getPaneData = getPaneData;
19
21
  var TransferObject = /** @class */ (function () {
20
22
  function TransferObject() {
21
23
  }
@@ -23,11 +25,12 @@ var TransferObject = /** @class */ (function () {
23
25
  }());
24
26
  var PanelTransfer = /** @class */ (function (_super) {
25
27
  __extends(PanelTransfer, _super);
26
- function PanelTransfer(viewId, groupId, panelId) {
28
+ function PanelTransfer(viewId, groupId, panelId, tabGroupId) {
27
29
  var _this = _super.call(this) || this;
28
30
  _this.viewId = viewId;
29
31
  _this.groupId = groupId;
30
32
  _this.panelId = panelId;
33
+ _this.tabGroupId = tabGroupId;
31
34
  return _this;
32
35
  }
33
36
  return PanelTransfer;
@@ -87,7 +90,6 @@ function getPanelData() {
87
90
  }
88
91
  return panelTransfer.getData(PanelTransfer.prototype)[0];
89
92
  }
90
- exports.getPanelData = getPanelData;
91
93
  function getPaneData() {
92
94
  var paneTransfer = LocalSelectionTransfer.getInstance();
93
95
  var isPanelEvent = paneTransfer.hasData(PaneTransfer.prototype);
@@ -96,4 +98,3 @@ function getPaneData() {
96
98
  }
97
99
  return paneTransfer.getData(PaneTransfer.prototype)[0];
98
100
  }
99
- exports.getPaneData = getPaneData;
@@ -26,6 +26,18 @@ export type MeasuredValue = {
26
26
  export type DroptargetOverlayModel = {
27
27
  size?: MeasuredValue;
28
28
  activationSize?: MeasuredValue;
29
+ /**
30
+ * Override the width threshold (in pixels) below which the overlay switches
31
+ * to a thin-border indicator instead of a half-width highlight. Set to 0 to
32
+ * always show the half-width overlay regardless of element size.
33
+ */
34
+ smallWidthBoundary?: number;
35
+ /**
36
+ * Override the height threshold (in pixels) below which the overlay switches
37
+ * to a thin-border indicator instead of a half-height highlight. Set to 0 to
38
+ * always show the half-height overlay regardless of element size.
39
+ */
40
+ smallHeightBoundary?: number;
29
41
  };
30
42
  export interface DropTargetTargetModel {
31
43
  getElements(event?: DragEvent, outline?: HTMLElement): {