dockview 1.4.1 → 1.5.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 (156) hide show
  1. package/README.md +4 -195
  2. package/dist/cjs/api/component.api.d.ts +8 -3
  3. package/dist/cjs/api/component.api.js +16 -4
  4. package/dist/cjs/api/component.api.js.map +1 -1
  5. package/dist/cjs/dnd/droptarget.d.ts +1 -2
  6. package/dist/cjs/dockview/components/tab/defaultTab.d.ts +1 -0
  7. package/dist/cjs/dockview/components/tab/defaultTab.js +6 -3
  8. package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
  9. package/dist/cjs/dockview/components/watermark/watermark.js +3 -1
  10. package/dist/cjs/dockview/components/watermark/watermark.js.map +1 -1
  11. package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -5
  12. package/dist/cjs/dockview/defaultGroupPanelView.js +5 -20
  13. package/dist/cjs/dockview/defaultGroupPanelView.js.map +1 -1
  14. package/dist/cjs/dockview/deserializer.d.ts +0 -12
  15. package/dist/cjs/dockview/deserializer.js +0 -52
  16. package/dist/cjs/dockview/deserializer.js.map +1 -1
  17. package/dist/cjs/dockview/dockviewComponent.d.ts +6 -8
  18. package/dist/cjs/dockview/dockviewComponent.js +84 -58
  19. package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
  20. package/dist/cjs/dockview/options.d.ts +11 -1
  21. package/dist/cjs/gridview/baseComponentGridview.d.ts +4 -2
  22. package/dist/cjs/gridview/baseComponentGridview.js +1 -1
  23. package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
  24. package/dist/cjs/gridview/gridviewComponent.d.ts +1 -0
  25. package/dist/cjs/gridview/gridviewComponent.js +26 -18
  26. package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
  27. package/dist/cjs/groupview/groupview.d.ts +20 -18
  28. package/dist/cjs/groupview/groupview.js +44 -41
  29. package/dist/cjs/groupview/groupview.js.map +1 -1
  30. package/dist/cjs/groupview/groupviewPanel.d.ts +2 -2
  31. package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
  32. package/dist/cjs/groupview/tab.d.ts +1 -0
  33. package/dist/cjs/groupview/tab.js +3 -1
  34. package/dist/cjs/groupview/tab.js.map +1 -1
  35. package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +3 -5
  36. package/dist/cjs/groupview/titlebar/tabsContainer.js +3 -5
  37. package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
  38. package/dist/cjs/groupview/types.d.ts +0 -4
  39. package/dist/cjs/index.d.ts +2 -0
  40. package/dist/cjs/index.js +1 -0
  41. package/dist/cjs/index.js.map +1 -1
  42. package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +3 -0
  43. package/dist/cjs/paneview/defaultPaneviewHeader.js +32 -6
  44. package/dist/cjs/paneview/defaultPaneviewHeader.js.map +1 -1
  45. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +3 -1
  46. package/dist/cjs/paneview/draggablePaneviewPanel.js +24 -9
  47. package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
  48. package/dist/cjs/paneview/options.d.ts +2 -0
  49. package/dist/cjs/paneview/paneviewComponent.d.ts +14 -1
  50. package/dist/cjs/paneview/paneviewComponent.js +32 -17
  51. package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
  52. package/dist/cjs/react/deserializer.js +13 -5
  53. package/dist/cjs/react/deserializer.js.map +1 -1
  54. package/dist/cjs/react/dockview/defaultTab.d.ts +4 -0
  55. package/dist/cjs/react/dockview/defaultTab.js +73 -0
  56. package/dist/cjs/react/dockview/defaultTab.js.map +1 -0
  57. package/dist/cjs/react/dockview/dockview.d.ts +5 -3
  58. package/dist/cjs/react/dockview/dockview.js +45 -3
  59. package/dist/cjs/react/dockview/dockview.js.map +1 -1
  60. package/dist/cjs/react/dockview/groupControlsRenderer.d.ts +43 -0
  61. package/dist/cjs/react/dockview/groupControlsRenderer.js +87 -0
  62. package/dist/cjs/react/dockview/groupControlsRenderer.js.map +1 -0
  63. package/dist/cjs/react/dockview/reactContentPart.d.ts +1 -16
  64. package/dist/cjs/react/dockview/reactContentPart.js +2 -18
  65. package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
  66. package/dist/cjs/react/dockview/reactHeaderPart.d.ts +2 -0
  67. package/dist/cjs/react/dockview/reactHeaderPart.js +4 -0
  68. package/dist/cjs/react/dockview/reactHeaderPart.js.map +1 -1
  69. package/dist/cjs/react/index.d.ts +2 -2
  70. package/dist/cjs/react/index.js +1 -2
  71. package/dist/cjs/react/index.js.map +1 -1
  72. package/dist/cjs/react/paneview/paneview.d.ts +2 -0
  73. package/dist/cjs/react/paneview/paneview.js +9 -0
  74. package/dist/cjs/react/paneview/paneview.js.map +1 -1
  75. package/dist/cjs/react/react.d.ts +1 -0
  76. package/dist/cjs/react/react.js +12 -2
  77. package/dist/cjs/react/react.js.map +1 -1
  78. package/dist/cjs/react/svg.d.ts +3 -0
  79. package/dist/cjs/react/svg.js +36 -0
  80. package/dist/cjs/react/svg.js.map +1 -0
  81. package/dist/cjs/splitview/splitviewComponent.d.ts +2 -0
  82. package/dist/cjs/splitview/splitviewComponent.js +20 -17
  83. package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
  84. package/dist/cjs/svg.d.ts +3 -0
  85. package/dist/cjs/svg.js +44 -0
  86. package/dist/cjs/svg.js.map +1 -0
  87. package/dist/dockview.amd.js +454 -204
  88. package/dist/dockview.amd.min.js +2 -2
  89. package/dist/dockview.amd.min.noStyle.js +2 -2
  90. package/dist/dockview.amd.noStyle.js +453 -203
  91. package/dist/dockview.cjs.js +454 -204
  92. package/dist/dockview.esm.js +449 -198
  93. package/dist/dockview.esm.min.js +2 -2
  94. package/dist/dockview.js +454 -204
  95. package/dist/dockview.min.js +2 -2
  96. package/dist/dockview.min.noStyle.js +2 -2
  97. package/dist/dockview.noStyle.js +453 -203
  98. package/dist/esm/api/component.api.d.ts +8 -3
  99. package/dist/esm/api/component.api.js +16 -4
  100. package/dist/esm/dnd/droptarget.d.ts +1 -2
  101. package/dist/esm/dockview/components/tab/defaultTab.d.ts +1 -0
  102. package/dist/esm/dockview/components/tab/defaultTab.js +5 -2
  103. package/dist/esm/dockview/components/watermark/watermark.js +3 -1
  104. package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -5
  105. package/dist/esm/dockview/defaultGroupPanelView.js +5 -16
  106. package/dist/esm/dockview/deserializer.d.ts +0 -12
  107. package/dist/esm/dockview/deserializer.js +1 -27
  108. package/dist/esm/dockview/dockviewComponent.d.ts +6 -8
  109. package/dist/esm/dockview/dockviewComponent.js +56 -41
  110. package/dist/esm/dockview/options.d.ts +11 -1
  111. package/dist/esm/gridview/baseComponentGridview.d.ts +4 -2
  112. package/dist/esm/gridview/baseComponentGridview.js +1 -1
  113. package/dist/esm/gridview/gridviewComponent.d.ts +1 -0
  114. package/dist/esm/gridview/gridviewComponent.js +15 -7
  115. package/dist/esm/groupview/groupview.d.ts +20 -18
  116. package/dist/esm/groupview/groupview.js +42 -40
  117. package/dist/esm/groupview/groupviewPanel.d.ts +2 -2
  118. package/dist/esm/groupview/tab.d.ts +1 -0
  119. package/dist/esm/groupview/tab.js +3 -1
  120. package/dist/esm/groupview/titlebar/tabsContainer.d.ts +3 -5
  121. package/dist/esm/groupview/titlebar/tabsContainer.js +3 -5
  122. package/dist/esm/groupview/types.d.ts +0 -4
  123. package/dist/esm/index.d.ts +2 -0
  124. package/dist/esm/index.js +1 -0
  125. package/dist/esm/paneview/defaultPaneviewHeader.d.ts +3 -0
  126. package/dist/esm/paneview/defaultPaneviewHeader.js +32 -6
  127. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +3 -1
  128. package/dist/esm/paneview/draggablePaneviewPanel.js +24 -9
  129. package/dist/esm/paneview/options.d.ts +2 -0
  130. package/dist/esm/paneview/paneviewComponent.d.ts +14 -1
  131. package/dist/esm/paneview/paneviewComponent.js +17 -6
  132. package/dist/esm/react/deserializer.js +13 -5
  133. package/dist/esm/react/dockview/defaultTab.d.ts +4 -0
  134. package/dist/esm/react/dockview/defaultTab.js +34 -0
  135. package/dist/esm/react/dockview/dockview.d.ts +5 -3
  136. package/dist/esm/react/dockview/dockview.js +30 -1
  137. package/dist/esm/react/dockview/groupControlsRenderer.d.ts +43 -0
  138. package/dist/esm/react/dockview/groupControlsRenderer.js +68 -0
  139. package/dist/esm/react/dockview/reactContentPart.d.ts +1 -16
  140. package/dist/esm/react/dockview/reactContentPart.js +2 -14
  141. package/dist/esm/react/dockview/reactHeaderPart.d.ts +2 -0
  142. package/dist/esm/react/dockview/reactHeaderPart.js +4 -0
  143. package/dist/esm/react/index.d.ts +2 -2
  144. package/dist/esm/react/index.js +1 -2
  145. package/dist/esm/react/paneview/paneview.d.ts +2 -0
  146. package/dist/esm/react/paneview/paneview.js +9 -0
  147. package/dist/esm/react/react.d.ts +1 -0
  148. package/dist/esm/react/react.js +12 -2
  149. package/dist/esm/react/svg.d.ts +3 -0
  150. package/dist/esm/react/svg.js +7 -0
  151. package/dist/esm/splitview/splitviewComponent.d.ts +2 -0
  152. package/dist/esm/splitview/splitviewComponent.js +9 -6
  153. package/dist/esm/svg.d.ts +3 -0
  154. package/dist/esm/svg.js +31 -0
  155. package/dist/styles/dockview.css +158 -40
  156. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.4.1
3
+ * @version 1.5.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2294,6 +2294,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2294
2294
  toJSON() {
2295
2295
  return this.component.toJSON();
2296
2296
  }
2297
+ clear() {
2298
+ this.component.clear();
2299
+ }
2297
2300
  }
2298
2301
  class PaneviewApi {
2299
2302
  constructor(component) {
@@ -2361,6 +2364,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2361
2364
  toJSON() {
2362
2365
  return this.component.toJSON();
2363
2366
  }
2367
+ clear() {
2368
+ this.component.clear();
2369
+ }
2364
2370
  }
2365
2371
  class GridviewApi {
2366
2372
  constructor(component) {
@@ -2387,13 +2393,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2387
2393
  get onDidLayoutChange() {
2388
2394
  return this.component.onDidLayoutChange;
2389
2395
  }
2390
- get onDidAddGroup() {
2396
+ get onDidAddPanel() {
2391
2397
  return this.component.onDidAddGroup;
2392
2398
  }
2393
- get onDidRemoveGroup() {
2399
+ get onDidRemovePanel() {
2394
2400
  return this.component.onDidRemoveGroup;
2395
2401
  }
2396
- get onDidActiveGroupChange() {
2402
+ get onDidActivePanelChange() {
2397
2403
  return this.component.onDidActiveGroupChange;
2398
2404
  }
2399
2405
  get onDidLayoutFromJSON() {
@@ -2432,6 +2438,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2432
2438
  toJSON() {
2433
2439
  return this.component.toJSON();
2434
2440
  }
2441
+ clear() {
2442
+ this.component.clear();
2443
+ }
2435
2444
  }
2436
2445
  class DockviewApi {
2437
2446
  constructor(component) {
@@ -2480,7 +2489,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2480
2489
  return this.component.onDidRemovePanel;
2481
2490
  }
2482
2491
  get onDidLayoutFromJSON() {
2483
- return this.component.onDidLayoutfromJSON;
2492
+ return this.component.onDidLayoutFromJSON;
2484
2493
  }
2485
2494
  get onDidLayoutChange() {
2486
2495
  return this.component.onDidLayoutChange;
@@ -2542,6 +2551,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2542
2551
  toJSON() {
2543
2552
  return this.component.toJSON();
2544
2553
  }
2554
+ clear() {
2555
+ this.component.clear();
2556
+ }
2545
2557
  }
2546
2558
 
2547
2559
  class ContentContainer extends CompositeDisposable {
@@ -2615,12 +2627,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2615
2627
  }
2616
2628
  }
2617
2629
 
2618
- var DockviewDropTargets;
2630
+ exports.DockviewDropTargets = void 0;
2619
2631
  (function (DockviewDropTargets) {
2620
2632
  DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
2621
2633
  DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
2622
2634
  DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
2623
- })(DockviewDropTargets || (DockviewDropTargets = {}));
2635
+ })(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
2624
2636
 
2625
2637
  class DragHandler extends CompositeDisposable {
2626
2638
  constructor(el) {
@@ -2666,6 +2678,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2666
2678
  constructor(panelId, accessor, group) {
2667
2679
  super();
2668
2680
  this.panelId = panelId;
2681
+ this.accessor = accessor;
2669
2682
  this.group = group;
2670
2683
  this._onChanged = new Emitter();
2671
2684
  this.onChanged = this._onChanged.event;
@@ -2676,6 +2689,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2676
2689
  this._element.className = 'tab';
2677
2690
  this._element.tabIndex = 0;
2678
2691
  this._element.draggable = true;
2692
+ toggleClass(this.element, 'inactive-tab', true);
2679
2693
  this.addDisposables(new (class Handler extends DragHandler {
2680
2694
  constructor() {
2681
2695
  super(...arguments);
@@ -2715,10 +2729,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2715
2729
  validOverlays: 'none',
2716
2730
  canDisplayOverlay: (event) => {
2717
2731
  const data = getPanelData();
2718
- if (data) {
2732
+ if (data && this.accessor.id === data.viewId) {
2719
2733
  return this.panelId !== data.panelId;
2720
2734
  }
2721
- return this.group.model.canDisplayOverlay(event, DockviewDropTargets.Tab);
2735
+ return this.group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Tab);
2722
2736
  },
2723
2737
  });
2724
2738
  this.addDisposables(this.droptarget.onDrop((event) => {
@@ -2752,7 +2766,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2752
2766
  this.group = group;
2753
2767
  this.tabs = [];
2754
2768
  this.selectedIndex = -1;
2755
- this.active = false;
2756
2769
  this._hidden = false;
2757
2770
  this._onDrop = new Emitter();
2758
2771
  this.onDrop = this._onDrop.event;
@@ -2774,11 +2787,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2774
2787
  canDisplayOverlay: (event) => {
2775
2788
  var _a;
2776
2789
  const data = getPanelData();
2777
- if (data) {
2790
+ if (data && this.accessor.id === data.viewId) {
2778
2791
  // don't show the overlay if the tab being dragged is the last panel of this group
2779
2792
  return ((_a = last(this.tabs)) === null || _a === void 0 ? void 0 : _a.value.panelId) !== data.panelId;
2780
2793
  }
2781
- return group.model.canDisplayOverlay(event, DockviewDropTargets.Panel);
2794
+ return group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2782
2795
  },
2783
2796
  });
2784
2797
  this.addDisposables(this.voidDropTarget.onDrop((event) => {
@@ -2856,8 +2869,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2856
2869
  indexOf(id) {
2857
2870
  return this.tabs.findIndex((tab) => tab.value.panelId === id);
2858
2871
  }
2859
- setActive(isGroupActive) {
2860
- this.active = isGroupActive;
2872
+ setActive(_isGroupActive) {
2873
+ // noop
2861
2874
  }
2862
2875
  addTab(tab, index = this.tabs.length) {
2863
2876
  if (index < 0 || index > this.tabs.length) {
@@ -2918,7 +2931,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2918
2931
  }));
2919
2932
  const value = { value: tabToAdd, disposable };
2920
2933
  this.addTab(value, index);
2921
- this.activePanel = panel;
2922
2934
  }
2923
2935
  closePanel(panel) {
2924
2936
  this.delete(panel.id);
@@ -2932,12 +2944,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2932
2944
  }
2933
2945
  }
2934
2946
 
2935
- exports.GroupChangeKind2 = void 0;
2936
- (function (GroupChangeKind2) {
2937
- GroupChangeKind2["ADD_PANEL"] = "ADD_PANEL";
2938
- GroupChangeKind2["REMOVE_PANEL"] = "REMOVE_PANEL";
2939
- GroupChangeKind2["PANEL_ACTIVE"] = "PANEL_ACTIVE";
2940
- })(exports.GroupChangeKind2 || (exports.GroupChangeKind2 = {}));
2941
2947
  class Groupview extends CompositeDisposable {
2942
2948
  constructor(container, accessor, id, options, parent) {
2943
2949
  super();
@@ -2956,12 +2962,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2956
2962
  this._panels = [];
2957
2963
  this._onMove = new Emitter();
2958
2964
  this.onMove = this._onMove.event;
2959
- this._onDidGroupChange = new Emitter();
2960
- this.onDidGroupChange = this._onDidGroupChange.event;
2961
2965
  this._onDidDrop = new Emitter();
2962
2966
  this.onDidDrop = this._onDidDrop.event;
2967
+ this._onDidAddPanel = new Emitter();
2968
+ this.onDidAddPanel = this._onDidAddPanel.event;
2969
+ this._onDidRemovePanel = new Emitter();
2970
+ this.onDidRemovePanel = this._onDidRemovePanel.event;
2971
+ this._onDidActivePanelChange = new Emitter();
2972
+ this.onDidActivePanelChange = this._onDidActivePanelChange.event;
2963
2973
  this.container.classList.add('groupview');
2964
- this.addDisposables(this._onMove, this._onDidGroupChange, this._onDidChange, this._onDidDrop);
2965
2974
  this.tabsContainer = new TabsContainer(this.accessor, this.parent, {
2966
2975
  tabHeight: options.tabHeight,
2967
2976
  });
@@ -2973,17 +2982,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2973
2982
  return false;
2974
2983
  }
2975
2984
  const data = getPanelData();
2976
- if (data) {
2985
+ if (data && data.viewId === this.accessor.id) {
2977
2986
  const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
2978
2987
  return !groupHasOnePanelAndIsActiveDragElement;
2979
2988
  }
2980
- return this.canDisplayOverlay(event, DockviewDropTargets.Panel);
2989
+ return this.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2981
2990
  },
2982
2991
  });
2983
2992
  container.append(this.tabsContainer.element, this.contentContainer.element);
2984
2993
  this.header.hidden = !!options.hideHeader;
2985
2994
  this.locked = !!options.locked;
2986
- this.addDisposables(this._onMove, this._onDidGroupChange, this.tabsContainer.onDrop((event) => {
2995
+ this.addDisposables(this._onMove, this._onDidChange, this._onDidDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange, this.tabsContainer.onDrop((event) => {
2987
2996
  this.handleDropEvent(event.event, exports.Position.Center, event.index);
2988
2997
  }), this.contentContainer.onDidFocus(() => {
2989
2998
  this.accessor.doSetGroupActive(this.parent, true);
@@ -3055,6 +3064,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3055
3064
  // correctly initialized
3056
3065
  this.setActive(this.isActive, true, true);
3057
3066
  this.updateContainer();
3067
+ if (this.accessor.options.createGroupControlElement) {
3068
+ this._control = this.accessor.options.createGroupControlElement(this.parent);
3069
+ this.addDisposables(this._control);
3070
+ this._control.init({
3071
+ containerApi: new DockviewApi(this.accessor),
3072
+ api: this.parent.api,
3073
+ });
3074
+ this.tabsContainer.setActionElement(this._control.element);
3075
+ }
3058
3076
  }
3059
3077
  indexOf(panel) {
3060
3078
  return this.tabsContainer.indexOf(panel.id);
@@ -3135,16 +3153,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3135
3153
  options.index > this.panels.length) {
3136
3154
  options.index = this.panels.length;
3137
3155
  }
3138
- const skipSetActive = !!options.skipSetActive;
3156
+ const skipSetPanelActive = !!options.skipSetPanelActive;
3157
+ const skipSetGroupActive = !!options.skipSetGroupActive;
3139
3158
  // ensure the group is updated before we fire any events
3140
3159
  panel.updateParentGroup(this.parent, true);
3141
- if (!skipSetActive && this._activePanel === panel) {
3142
- this.accessor.doSetGroupActive(this.parent);
3160
+ if (this._activePanel === panel) {
3161
+ if (!skipSetGroupActive) {
3162
+ this.accessor.doSetGroupActive(this.parent);
3163
+ }
3143
3164
  return;
3144
3165
  }
3145
- this.doAddPanel(panel, options.index);
3146
- if (!skipSetActive) {
3166
+ this.doAddPanel(panel, options.index, skipSetPanelActive);
3167
+ if (!skipSetPanelActive) {
3147
3168
  this.doSetActivePanel(panel);
3169
+ }
3170
+ if (!skipSetGroupActive) {
3148
3171
  this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
3149
3172
  }
3150
3173
  this.updateContainer();
@@ -3180,14 +3203,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3180
3203
  isPanelActive(panel) {
3181
3204
  return this._activePanel === panel;
3182
3205
  }
3183
- updateActions() {
3184
- var _a, _b;
3185
- if (this.isActive && ((_b = (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.actions)) {
3186
- this.tabsContainer.setActionElement(this._activePanel.view.actions.element);
3187
- }
3188
- else {
3189
- this.tabsContainer.setActionElement(undefined);
3190
- }
3206
+ updateActions(element) {
3207
+ this.tabsContainer.setActionElement(element);
3191
3208
  }
3192
3209
  setActive(isGroupActive, skipFocus = false, force = false) {
3193
3210
  var _a, _b;
@@ -3243,16 +3260,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3243
3260
  if (this.mostRecentlyUsed.includes(panel)) {
3244
3261
  this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
3245
3262
  }
3246
- this._onDidGroupChange.fire({
3247
- kind: exports.GroupChangeKind2.REMOVE_PANEL,
3248
- panel,
3249
- });
3263
+ this._onDidRemovePanel.fire({ panel });
3250
3264
  }
3251
- doAddPanel(panel, index = this.panels.length) {
3265
+ doAddPanel(panel, index = this.panels.length, skipSetActive = false) {
3252
3266
  const existingPanel = this._panels.indexOf(panel);
3253
3267
  const hasExistingPanel = existingPanel > -1;
3254
3268
  this.tabsContainer.openPanel(panel, index);
3255
- this.contentContainer.openPanel(panel);
3269
+ if (!skipSetActive) {
3270
+ this.contentContainer.openPanel(panel);
3271
+ }
3256
3272
  this.tabsContainer.show();
3257
3273
  this.contentContainer.show();
3258
3274
  if (hasExistingPanel) {
@@ -3261,10 +3277,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3261
3277
  }
3262
3278
  this.updateMru(panel);
3263
3279
  this.panels.splice(index, 0, panel);
3264
- this._onDidGroupChange.fire({
3265
- kind: exports.GroupChangeKind2.ADD_PANEL,
3266
- panel,
3267
- });
3280
+ this._onDidAddPanel.fire({ panel });
3268
3281
  }
3269
3282
  doSetActivePanel(panel) {
3270
3283
  this._activePanel = panel;
@@ -3272,10 +3285,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3272
3285
  this.tabsContainer.setActivePanel(panel);
3273
3286
  panel.layout(this._width, this._height);
3274
3287
  this.updateMru(panel);
3275
- this._onDidGroupChange.fire({
3276
- kind: exports.GroupChangeKind2.PANEL_ACTIVE,
3277
- panel,
3278
- });
3288
+ this._onDidActivePanelChange.fire({ panel });
3279
3289
  }
3280
3290
  }
3281
3291
  updateMru(panel) {
@@ -3285,7 +3295,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3285
3295
  this.mostRecentlyUsed = [panel, ...this.mostRecentlyUsed];
3286
3296
  }
3287
3297
  updateContainer() {
3288
- this.updateActions();
3289
3298
  toggleClass(this.container, 'empty', this.isEmpty);
3290
3299
  this.panels.forEach((panel) => panel.updateParentGroup(this.parent, this.isActive));
3291
3300
  if (this.isEmpty && !this.watermark) {
@@ -3318,7 +3327,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3318
3327
  canDisplayOverlay(event, target) {
3319
3328
  // custom overlay handler
3320
3329
  if (this.accessor.options.showDndOverlay) {
3321
- return this.accessor.options.showDndOverlay(event, target);
3330
+ return this.accessor.options.showDndOverlay({
3331
+ nativeEvent: event,
3332
+ target,
3333
+ group: this.accessor.getPanel(this.id),
3334
+ getData: getPanelData,
3335
+ });
3322
3336
  }
3323
3337
  return false;
3324
3338
  }
@@ -3366,7 +3380,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3366
3380
  }
3367
3381
  }
3368
3382
 
3369
- const nextLayoutId = sequentialNumberGenerator();
3383
+ const nextLayoutId$1 = sequentialNumberGenerator();
3370
3384
  function toTarget(direction) {
3371
3385
  switch (direction) {
3372
3386
  case 'left':
@@ -3386,7 +3400,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3386
3400
  constructor(_element, options) {
3387
3401
  super();
3388
3402
  this._element = _element;
3389
- this._id = nextLayoutId.next();
3403
+ this._id = nextLayoutId$1.next();
3390
3404
  this._groups = new Map();
3391
3405
  this._onDidLayoutChange = new Emitter();
3392
3406
  this.onDidLayoutChange = this._onDidLayoutChange.event;
@@ -3401,7 +3415,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3401
3415
  this.element.appendChild(this.gridview.element);
3402
3416
  this.layout(0, 0, true); // set some elements height/widths
3403
3417
  this.addDisposables(this.gridview.onDidChange(() => {
3404
- this._onDidLayoutChange.fire();
3418
+ this._bufferOnDidLayoutChange.fire();
3405
3419
  }));
3406
3420
  this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
3407
3421
  this._bufferOnDidLayoutChange.fire();
@@ -3846,6 +3860,38 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3846
3860
  }
3847
3861
  }
3848
3862
 
3863
+ const createSvgElementFromPath = (params) => {
3864
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
3865
+ svg.setAttributeNS(null, 'height', params.height);
3866
+ svg.setAttributeNS(null, 'width', params.width);
3867
+ svg.setAttributeNS(null, 'viewBox', params.viewbox);
3868
+ svg.setAttributeNS(null, 'aria-hidden', 'false');
3869
+ svg.setAttributeNS(null, 'focusable', 'false');
3870
+ svg.classList.add('dockview-svg');
3871
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
3872
+ path.setAttributeNS(null, 'd', params.path);
3873
+ svg.appendChild(path);
3874
+ return svg;
3875
+ };
3876
+ const createCloseButton = () => createSvgElementFromPath({
3877
+ width: '11',
3878
+ height: '11',
3879
+ viewbox: '0 0 28 28',
3880
+ path: 'M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z',
3881
+ });
3882
+ const createExpandMoreButton = () => createSvgElementFromPath({
3883
+ width: '11',
3884
+ height: '11',
3885
+ viewbox: '0 0 24 15',
3886
+ path: 'M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z',
3887
+ });
3888
+ const createChevronRightButton = () => createSvgElementFromPath({
3889
+ width: '11',
3890
+ height: '11',
3891
+ viewbox: '0 0 15 25',
3892
+ path: 'M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z',
3893
+ });
3894
+
3849
3895
  class Watermark extends CompositeDisposable {
3850
3896
  constructor() {
3851
3897
  super();
@@ -3862,8 +3908,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3862
3908
  const actions = new ActionContainer();
3863
3909
  title.appendChild(emptySpace);
3864
3910
  title.appendChild(actions.element);
3865
- const closeAnchor = document.createElement('a');
3911
+ const closeAnchor = document.createElement('div');
3866
3912
  closeAnchor.className = 'close-action';
3913
+ closeAnchor.appendChild(createCloseButton());
3867
3914
  actions.add(closeAnchor);
3868
3915
  this.addDisposables(addDisposableListener(closeAnchor, 'click', (ev) => {
3869
3916
  var _a;
@@ -3911,34 +3958,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3911
3958
  }
3912
3959
  }
3913
3960
 
3914
- class DefaultDeserializer {
3915
- constructor(layout, panelDeserializer) {
3916
- this.layout = layout;
3917
- this.panelDeserializer = panelDeserializer;
3918
- }
3919
- fromJSON(node) {
3920
- const data = node.data;
3921
- const children = data.views;
3922
- const active = data.activeView;
3923
- const group = this.layout.createGroup({
3924
- id: data.id,
3925
- locked: !!data.locked,
3926
- hideHeader: !!data.hideHeader,
3927
- });
3928
- for (const child of children) {
3929
- const panel = this.panelDeserializer.createPanel(child, group);
3930
- const isActive = typeof active === 'string' && active === panel.id;
3931
- group.model.openPanel(panel, {
3932
- skipSetActive: !isActive,
3933
- });
3934
- }
3935
- if (!group.activePanel && group.panels.length > 0) {
3936
- group.model.openPanel(group.panels[group.panels.length - 1]);
3937
- }
3938
- return group;
3939
- }
3940
- }
3941
-
3942
3961
  function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
3943
3962
  const Component = typeof componentName === 'string'
3944
3963
  ? components[componentName]
@@ -3964,6 +3983,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3964
3983
  return new Component(id, componentName);
3965
3984
  }
3966
3985
 
3986
+ const DEFAULT_TAB_IDENTIFIER = '__default__tab__';
3967
3987
  class DefaultTab extends CompositeDisposable {
3968
3988
  constructor() {
3969
3989
  super();
@@ -3983,8 +4003,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3983
4003
  this._list = document.createElement('ul');
3984
4004
  this._list.className = 'tab-list';
3985
4005
  //
3986
- this.action = document.createElement('a');
4006
+ this.action = document.createElement('div');
3987
4007
  this.action.className = 'tab-action';
4008
+ this.action.appendChild(createCloseButton());
3988
4009
  //
3989
4010
  this._element.appendChild(this._content);
3990
4011
  this._element.appendChild(this._actionContainer);
@@ -4000,7 +4021,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4000
4021
  return this._element;
4001
4022
  }
4002
4023
  get id() {
4003
- return '__DEFAULT_TAB__';
4024
+ return DEFAULT_TAB_IDENTIFIER;
4004
4025
  }
4005
4026
  update(event) {
4006
4027
  this.params = Object.assign(Object.assign({}, this.params), event.params);
@@ -4317,16 +4338,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4317
4338
  var _a;
4318
4339
  this._content = renderers.content;
4319
4340
  this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
4320
- this._actions =
4321
- renderers.actions ||
4322
- (this.content.actions
4323
- ? {
4324
- element: this.content.actions,
4325
- dispose: () => {
4326
- //
4327
- },
4328
- }
4329
- : undefined);
4330
4341
  }
4331
4342
  get content() {
4332
4343
  return this._content;
@@ -4334,9 +4345,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4334
4345
  get tab() {
4335
4346
  return this._tab;
4336
4347
  }
4337
- get actions() {
4338
- return this._actions;
4339
- }
4340
4348
  init(params) {
4341
4349
  this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
4342
4350
  this.tab.init(params);
@@ -4354,16 +4362,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4354
4362
  this.tab.update(event);
4355
4363
  }
4356
4364
  toJSON() {
4365
+ let tab = this.tab instanceof DefaultTab ? undefined : this.tab.toJSON();
4366
+ if (tab && Object.keys(tab).length === 0) {
4367
+ tab = undefined;
4368
+ }
4357
4369
  return {
4358
4370
  content: this.content.toJSON(),
4359
- tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
4371
+ tab,
4360
4372
  };
4361
4373
  }
4362
4374
  dispose() {
4363
- var _a;
4364
4375
  this.content.dispose();
4365
4376
  this.tab.dispose();
4366
- (_a = this.actions) === null || _a === void 0 ? void 0 : _a.dispose();
4367
4377
  }
4368
4378
  }
4369
4379
 
@@ -4375,9 +4385,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4375
4385
  orientation: options.orientation || exports.Orientation.HORIZONTAL,
4376
4386
  styles: options.styles,
4377
4387
  });
4378
- // events
4379
- this._onTabInteractionEvent = new Emitter();
4380
- this.onTabInteractionEvent = this._onTabInteractionEvent.event;
4381
4388
  this._onTabContextMenu = new Emitter();
4382
4389
  this.onTabContextMenu = this._onTabContextMenu.event;
4383
4390
  this._onDidDrop = new Emitter();
@@ -4386,11 +4393,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4386
4393
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4387
4394
  this._onDidAddPanel = new Emitter();
4388
4395
  this.onDidAddPanel = this._onDidAddPanel.event;
4389
- this._onDidLayoutfromJSON = new Emitter();
4390
- this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
4396
+ this._onDidLayoutFromJSON = new Emitter();
4397
+ this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
4391
4398
  this._onDidActivePanelChange = new Emitter();
4392
4399
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
4393
- this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4400
+ this.addDisposables(this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4394
4401
  this._bufferOnDidLayoutChange.fire();
4395
4402
  }));
4396
4403
  this._options = options;
@@ -4445,7 +4452,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4445
4452
  }
4446
4453
  updateOptions(options) {
4447
4454
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4448
- this.options.orientation !== options.orientation;
4455
+ this.gridview.orientation !== options.orientation;
4449
4456
  this._options = Object.assign(Object.assign({}, this.options), options);
4450
4457
  if (hasOrientationChanged) {
4451
4458
  this.gridview.orientation = options.orientation;
@@ -4523,12 +4530,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4523
4530
  };
4524
4531
  }
4525
4532
  fromJSON(data) {
4526
- const groups = Array.from(this._groups.values()).map((_) => _.value);
4527
- for (const group of groups) {
4528
- // remove the group will automatically remove the panels
4529
- this.removeGroup(group, true);
4530
- }
4531
- this.gridview.clear();
4533
+ this.clear();
4532
4534
  if (!this.deserializer) {
4533
4535
  throw new Error('invalid deserializer');
4534
4536
  }
@@ -4539,12 +4541,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4539
4541
  if (!this.deserializer) {
4540
4542
  throw new Error('no deserializer provided');
4541
4543
  }
4542
- this.gridview.deserialize(grid, new DefaultDeserializer(this, {
4543
- createPanel: (id, group) => {
4544
- const panelData = panels[id];
4545
- return this.deserializer.fromJSON(panelData, group);
4546
- },
4547
- }));
4544
+ this.gridview.deserialize(grid, {
4545
+ fromJSON: (node) => {
4546
+ const { id, locked, hideHeader, views, activeView } = node.data;
4547
+ const group = this.createGroup({
4548
+ id,
4549
+ locked: !!locked,
4550
+ hideHeader: !!hideHeader,
4551
+ });
4552
+ this._onDidAddGroup.fire(group);
4553
+ for (const child of views) {
4554
+ const panel = this.deserializer.fromJSON(panels[child], group);
4555
+ const isActive = typeof activeView === 'string' && activeView === panel.id;
4556
+ group.model.openPanel(panel, {
4557
+ skipSetPanelActive: !isActive,
4558
+ skipSetGroupActive: true
4559
+ });
4560
+ }
4561
+ if (!group.activePanel && group.panels.length > 0) {
4562
+ group.model.openPanel(group.panels[group.panels.length - 1], {
4563
+ skipSetGroupActive: true
4564
+ });
4565
+ }
4566
+ return group;
4567
+ }
4568
+ });
4548
4569
  if (typeof activeGroup === 'string') {
4549
4570
  const panel = this.getPanel(activeGroup);
4550
4571
  if (panel) {
@@ -4552,7 +4573,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4552
4573
  }
4553
4574
  }
4554
4575
  this.gridview.layout(this.width, this.height);
4555
- this._onDidLayoutfromJSON.fire();
4576
+ this._onDidLayoutFromJSON.fire();
4577
+ }
4578
+ clear() {
4579
+ const groups = Array.from(this._groups.values()).map((_) => _.value);
4580
+ const hasActiveGroup = !!this.activeGroup;
4581
+ const hasActivePanel = !!this.activePanel;
4582
+ for (const group of groups) {
4583
+ // remove the group will automatically remove the panels
4584
+ this.removeGroup(group, true);
4585
+ }
4586
+ if (hasActiveGroup) {
4587
+ this.doSetGroupActive(undefined);
4588
+ }
4589
+ if (hasActivePanel) {
4590
+ this._onDidActivePanelChange.fire(undefined);
4591
+ }
4592
+ this.gridview.clear();
4556
4593
  }
4557
4594
  closeAllGroups() {
4558
4595
  for (const entry of this._groups.entries()) {
@@ -4750,23 +4787,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4750
4787
  const { groupId, itemId, target, index } = event;
4751
4788
  this.moveGroupOrPanel(view, groupId, itemId, target, index);
4752
4789
  }), view.model.onDidDrop((event) => {
4753
- this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
4754
- }), view.model.onDidGroupChange((event) => {
4755
- switch (event.kind) {
4756
- case exports.GroupChangeKind2.ADD_PANEL:
4757
- if (event.panel) {
4758
- this._onDidAddPanel.fire(event.panel);
4759
- }
4760
- break;
4761
- case exports.GroupChangeKind2.REMOVE_PANEL:
4762
- if (event.panel) {
4763
- this._onDidRemovePanel.fire(event.panel);
4764
- }
4765
- break;
4766
- case exports.GroupChangeKind2.PANEL_ACTIVE:
4767
- this._onDidActivePanelChange.fire(event.panel);
4768
- break;
4769
- }
4790
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: view }));
4791
+ }), view.model.onDidAddPanel((event) => {
4792
+ this._onDidAddPanel.fire(event.panel);
4793
+ }), view.model.onDidRemovePanel((event) => {
4794
+ this._onDidRemovePanel.fire(event.panel);
4795
+ }), view.model.onDidActivePanelChange((event) => {
4796
+ this._onDidActivePanelChange.fire(event.panel);
4770
4797
  }));
4771
4798
  this._groups.set(view.id, { value: view, disposable });
4772
4799
  }
@@ -4781,7 +4808,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4781
4808
  createPanel(options, group) {
4782
4809
  const view = new DefaultGroupPanelView({
4783
4810
  content: this.createContentComponent(options.id, options.component),
4784
- tab: this.createTabComponent(options.id, options.tabComponent),
4811
+ tab: this.createTabComponent(options.id, options.tabComponent || this.options.defaultTabComponent),
4785
4812
  });
4786
4813
  const panel = new DockviewGroupPanel(options.id, this, this._api, group);
4787
4814
  panel.init({
@@ -4814,7 +4841,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4814
4841
  this._onDidActivePanelChange.dispose();
4815
4842
  this._onDidAddPanel.dispose();
4816
4843
  this._onDidRemovePanel.dispose();
4817
- this._onDidLayoutfromJSON.dispose();
4844
+ this._onDidLayoutFromJSON.dispose();
4818
4845
  }
4819
4846
  }
4820
4847
 
@@ -4852,7 +4879,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4852
4879
  }
4853
4880
  updateOptions(options) {
4854
4881
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4855
- this.options.orientation !== options.orientation;
4882
+ this.gridview.orientation !== options.orientation;
4856
4883
  this._options = Object.assign(Object.assign({}, this.options), options);
4857
4884
  if (hasOrientationChanged) {
4858
4885
  this.gridview.orientation = options.orientation;
@@ -4888,13 +4915,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4888
4915
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
4889
4916
  }
4890
4917
  fromJSON(serializedGridview) {
4918
+ this.clear();
4891
4919
  const { grid, activePanel } = serializedGridview;
4892
- const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4893
- for (const group of groups) {
4894
- group.disposable.dispose();
4895
- this.doRemoveGroup(group.value, { skipActive: true });
4896
- }
4897
- this.gridview.clear();
4898
4920
  const queue = [];
4899
4921
  this.gridview.deserialize(grid, {
4900
4922
  fromJSON: (node) => {
@@ -4916,6 +4938,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4916
4938
  accessor: this,
4917
4939
  isVisible: node.visible,
4918
4940
  }));
4941
+ this._onDidAddGroup.fire(view);
4919
4942
  this.registerPanel(view);
4920
4943
  return view;
4921
4944
  },
@@ -4930,6 +4953,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4930
4953
  }
4931
4954
  this._onDidLayoutfromJSON.fire();
4932
4955
  }
4956
+ clear() {
4957
+ const hasActiveGroup = this.activeGroup;
4958
+ const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4959
+ for (const group of groups) {
4960
+ group.disposable.dispose();
4961
+ this.doRemoveGroup(group.value, { skipActive: true });
4962
+ }
4963
+ if (hasActiveGroup) {
4964
+ this.doSetGroupActive(undefined);
4965
+ }
4966
+ this.gridview.clear();
4967
+ }
4933
4968
  movePanel(panel, options) {
4934
4969
  var _a;
4935
4970
  let relativeLocation;
@@ -5220,13 +5255,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5220
5255
  };
5221
5256
  }
5222
5257
  fromJSON(serializedSplitview) {
5258
+ this.clear();
5223
5259
  const { views, orientation, size, activeView } = serializedSplitview;
5224
- for (const [_, value] of this._panels.entries()) {
5225
- value.disposable.dispose();
5226
- value.value.dispose();
5227
- }
5228
- this._panels.clear();
5229
- this.splitview.dispose();
5230
5260
  const queue = [];
5231
5261
  this.splitview = new Splitview(this.element, {
5232
5262
  orientation,
@@ -5274,6 +5304,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5274
5304
  }
5275
5305
  this._onDidLayoutfromJSON.fire();
5276
5306
  }
5307
+ clear() {
5308
+ for (const [_, value] of this._panels.entries()) {
5309
+ value.disposable.dispose();
5310
+ value.value.dispose();
5311
+ }
5312
+ this._panels.clear();
5313
+ this.splitview.dispose();
5314
+ }
5277
5315
  dispose() {
5278
5316
  for (const [_, value] of this._panels.entries()) {
5279
5317
  value.disposable.dispose();
@@ -5523,8 +5561,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5523
5561
  }
5524
5562
 
5525
5563
  class DraggablePaneviewPanel extends PaneviewPanel {
5526
- constructor(id, component, headerComponent, orientation, isExpanded, disableDnd) {
5564
+ constructor(accessor, id, component, headerComponent, orientation, isExpanded, disableDnd) {
5527
5565
  super(id, component, headerComponent, orientation, isExpanded, true);
5566
+ this.accessor = accessor;
5528
5567
  this._onDidDrop = new Emitter();
5529
5568
  this.onDidDrop = this._onDidDrop.event;
5530
5569
  if (!disableDnd) {
@@ -5536,10 +5575,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5536
5575
  return;
5537
5576
  }
5538
5577
  const id = this.id;
5578
+ const accessorId = this.accessor.id;
5539
5579
  this.header.draggable = true;
5540
5580
  this.handler = new (class PaneDragHandler extends DragHandler {
5541
5581
  getData() {
5542
- LocalSelectionTransfer.getInstance().setData([new PaneTransfer('paneview', id)], PaneTransfer.prototype);
5582
+ LocalSelectionTransfer.getInstance().setData([new PaneTransfer(accessorId, id)], PaneTransfer.prototype);
5543
5583
  return {
5544
5584
  dispose: () => {
5545
5585
  LocalSelectionTransfer.getInstance().clearData(PaneTransfer.prototype);
@@ -5549,12 +5589,22 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5549
5589
  })(this.header);
5550
5590
  this.target = new Droptarget(this.element, {
5551
5591
  validOverlays: 'vertical',
5552
- canDisplayOverlay: () => {
5592
+ canDisplayOverlay: (event) => {
5553
5593
  const data = getPaneData();
5554
- if (!data) {
5555
- return true;
5594
+ if (data) {
5595
+ if (data.paneId !== this.id &&
5596
+ data.viewId === this.accessor.id) {
5597
+ return true;
5598
+ }
5556
5599
  }
5557
- return data.paneId !== this.id;
5600
+ if (this.accessor.options.showDndOverlay) {
5601
+ return this.accessor.options.showDndOverlay({
5602
+ nativeEvent: event,
5603
+ getData: getPaneData,
5604
+ panel: this,
5605
+ });
5606
+ }
5607
+ return false;
5558
5608
  },
5559
5609
  });
5560
5610
  this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
@@ -5563,8 +5613,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5563
5613
  }
5564
5614
  onDrop(event) {
5565
5615
  const data = getPaneData();
5566
- if (!data) {
5567
- this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
5616
+ if (!data || data.viewId !== this.accessor.id) {
5617
+ // if there is no local drag event for this panel
5618
+ // or if the drag event was creating by another Paneview instance
5619
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: getPaneData }));
5568
5620
  return;
5569
5621
  }
5570
5622
  const containerApi = this._params
@@ -5572,7 +5624,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5572
5624
  const panelId = data.paneId;
5573
5625
  const existingPanel = containerApi.getPanel(panelId);
5574
5626
  if (!existingPanel) {
5575
- this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: () => getPaneData() }));
5627
+ // if the panel doesn't exist
5628
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { panel: this, getData: getPaneData }));
5576
5629
  return;
5577
5630
  }
5578
5631
  const allPanels = containerApi.panels;
@@ -5596,15 +5649,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5596
5649
  class DefaultHeader extends CompositeDisposable {
5597
5650
  constructor() {
5598
5651
  super();
5652
+ this._expandedIcon = createExpandMoreButton();
5653
+ this._collapsedIcon = createChevronRightButton();
5599
5654
  this.disposable = new MutableDisposable();
5600
5655
  this.apiRef = { api: null };
5601
5656
  this._element = document.createElement('div');
5602
5657
  this.element.className = 'default-header';
5603
5658
  this._content = document.createElement('span');
5604
- this._expander = document.createElement('a');
5605
- this.element.appendChild(this._content);
5659
+ this._expander = document.createElement('div');
5660
+ this._expander.className = 'dockview-pane-header-icon';
5606
5661
  this.element.appendChild(this._expander);
5607
- this.addDisposables(addDisposableListener(this._expander, 'click', () => {
5662
+ this.element.appendChild(this._content);
5663
+ this.addDisposables(addDisposableListener(this._element, 'click', () => {
5608
5664
  var _a;
5609
5665
  (_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.setExpanded(!this.apiRef.api.isExpanded);
5610
5666
  }));
@@ -5615,11 +5671,32 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5615
5671
  init(params) {
5616
5672
  this.apiRef.api = params.api;
5617
5673
  this._content.textContent = params.title;
5618
- this._expander.textContent = params.api.isExpanded ? '<' : '>';
5619
- this.disposable.value = params.api.onDidExpansionChange((e) => {
5620
- this._expander.textContent = e.isExpanded ? '<' : '>';
5674
+ this.updateIcon();
5675
+ this.disposable.value = params.api.onDidExpansionChange(() => {
5676
+ this.updateIcon();
5621
5677
  });
5622
5678
  }
5679
+ updateIcon() {
5680
+ var _a;
5681
+ const isExpanded = !!((_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.isExpanded);
5682
+ toggleClass(this._expander, 'collapsed', !isExpanded);
5683
+ if (isExpanded) {
5684
+ if (this._expander.contains(this._collapsedIcon)) {
5685
+ this._collapsedIcon.remove();
5686
+ }
5687
+ if (!this._expander.contains(this._expandedIcon)) {
5688
+ this._expander.appendChild(this._expandedIcon);
5689
+ }
5690
+ }
5691
+ else {
5692
+ if (this._expander.contains(this._expandedIcon)) {
5693
+ this._expandedIcon.remove();
5694
+ }
5695
+ if (!this._expander.contains(this._collapsedIcon)) {
5696
+ this._expander.appendChild(this._collapsedIcon);
5697
+ }
5698
+ }
5699
+ }
5623
5700
  update(_params) {
5624
5701
  //
5625
5702
  }
@@ -5629,9 +5706,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5629
5706
  }
5630
5707
  }
5631
5708
 
5709
+ const nextLayoutId = sequentialNumberGenerator();
5632
5710
  class PaneFramework extends DraggablePaneviewPanel {
5633
5711
  constructor(options) {
5634
- super(options.id, options.component, options.headerComponent, options.orientation, options.isExpanded, options.disableDnd);
5712
+ super(options.accessor, options.id, options.component, options.headerComponent, options.orientation, options.isExpanded, options.disableDnd);
5635
5713
  this.options = options;
5636
5714
  }
5637
5715
  getBodyComponent() {
@@ -5645,6 +5723,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5645
5723
  constructor(element, options) {
5646
5724
  super();
5647
5725
  this.element = element;
5726
+ this._id = nextLayoutId.next();
5648
5727
  this._disposable = new MutableDisposable();
5649
5728
  this._viewDisposables = new Map();
5650
5729
  this._onDidLayoutfromJSON = new Emitter();
@@ -5671,6 +5750,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5671
5750
  });
5672
5751
  this.addDisposables(this._disposable);
5673
5752
  }
5753
+ get id() {
5754
+ return this._id;
5755
+ }
5674
5756
  get panels() {
5675
5757
  return this.paneview.getPanes();
5676
5758
  }
@@ -5735,6 +5817,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5735
5817
  orientation: exports.Orientation.VERTICAL,
5736
5818
  isExpanded: !!options.isExpanded,
5737
5819
  disableDnd: !!this.options.disableDnd,
5820
+ accessor: this,
5738
5821
  });
5739
5822
  this.doAddPanel(view);
5740
5823
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
@@ -5793,13 +5876,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5793
5876
  };
5794
5877
  }
5795
5878
  fromJSON(serializedPaneview) {
5879
+ this.clear();
5796
5880
  const { views, size } = serializedPaneview;
5797
5881
  const queue = [];
5798
- for (const [_, value] of this._viewDisposables.entries()) {
5799
- value.dispose();
5800
- }
5801
- this._viewDisposables.clear();
5802
- this.paneview.dispose();
5803
5882
  this.paneview = new Paneview(this.element, {
5804
5883
  orientation: exports.Orientation.VERTICAL,
5805
5884
  descriptor: {
@@ -5833,6 +5912,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5833
5912
  orientation: exports.Orientation.VERTICAL,
5834
5913
  isExpanded: !!view.expanded,
5835
5914
  disableDnd: !!this.options.disableDnd,
5915
+ accessor: this,
5836
5916
  });
5837
5917
  this.doAddPanel(panel);
5838
5918
  queue.push(() => {
@@ -5858,6 +5938,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5858
5938
  queue.forEach((f) => f());
5859
5939
  this._onDidLayoutfromJSON.fire();
5860
5940
  }
5941
+ clear() {
5942
+ for (const [_, value] of this._viewDisposables.entries()) {
5943
+ value.dispose();
5944
+ }
5945
+ this._viewDisposables.clear();
5946
+ this.paneview.dispose();
5947
+ }
5861
5948
  doAddPanel(panel) {
5862
5949
  const disposable = panel.onDidDrop((event) => {
5863
5950
  this._onDidDrop.fire(event);
@@ -6025,15 +6112,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6025
6112
  this.component = component;
6026
6113
  this.parameters = parameters;
6027
6114
  this.context = context;
6115
+ this._initialProps = {};
6028
6116
  this.disposed = false;
6029
6117
  this.createPortal();
6030
6118
  }
6031
6119
  update(props) {
6032
- var _a;
6033
6120
  if (this.disposed) {
6034
6121
  throw new Error('invalid operation: resource is already disposed');
6035
6122
  }
6036
- (_a = this.componentInstance) === null || _a === void 0 ? void 0 : _a.update(props);
6123
+ if (!this.componentInstance) {
6124
+ // if the component is yet to be mounted store the props
6125
+ this._initialProps = Object.assign(Object.assign({}, this._initialProps), props);
6126
+ }
6127
+ else {
6128
+ this.componentInstance.update(props);
6129
+ }
6037
6130
  }
6038
6131
  createPortal() {
6039
6132
  if (this.disposed) {
@@ -6053,6 +6146,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6053
6146
  componentProps: this.parameters,
6054
6147
  ref: (element) => {
6055
6148
  this.componentInstance = element;
6149
+ if (Object.keys(this._initialProps).length > 0) {
6150
+ this.componentInstance.update(this._initialProps);
6151
+ this._initialProps = {}; // don't keep a reference to the users object once no longer required
6152
+ }
6056
6153
  },
6057
6154
  });
6058
6155
  const node = this.context
@@ -6109,30 +6206,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6109
6206
  this.onDidBlur = this._onDidBlur.event;
6110
6207
  this._element = document.createElement('div');
6111
6208
  this._element.className = 'dockview-react-part';
6112
- this._actionsElement = document.createElement('div');
6113
- this._actionsElement.className = 'dockview-react-part';
6114
6209
  }
6115
6210
  get element() {
6116
6211
  return this._element;
6117
6212
  }
6118
- get actions() {
6119
- return this._actionsElement;
6120
- }
6121
6213
  focus() {
6122
6214
  // TODO
6123
6215
  }
6124
6216
  init(parameters) {
6125
- const context = {
6126
- api: parameters.api,
6127
- containerApi: parameters.containerApi,
6128
- actionsPortalElement: this._actionsElement,
6129
- tabPortalElement: parameters.tab,
6130
- };
6131
6217
  this.part = new ReactPart(this.element, this.reactPortalStore, this.component, {
6132
6218
  params: parameters.params,
6133
6219
  api: parameters.api,
6134
6220
  containerApi: parameters.containerApi,
6135
- }, context);
6221
+ });
6136
6222
  }
6137
6223
  toJSON() {
6138
6224
  return {
@@ -6150,11 +6236,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6150
6236
  // noop
6151
6237
  }
6152
6238
  dispose() {
6153
- var _a, _b;
6239
+ var _a;
6154
6240
  this._onDidFocus.dispose();
6155
6241
  this._onDidBlur.dispose();
6156
6242
  (_a = this.part) === null || _a === void 0 ? void 0 : _a.dispose();
6157
- (_b = this.actionsPart) === null || _b === void 0 ? void 0 : _b.dispose();
6158
6243
  }
6159
6244
  }
6160
6245
 
@@ -6184,6 +6269,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6184
6269
  (_a = this.part) === null || _a === void 0 ? void 0 : _a.update(event.params);
6185
6270
  }
6186
6271
  toJSON() {
6272
+ if (this.id === DEFAULT_TAB_IDENTIFIER) {
6273
+ return {};
6274
+ }
6187
6275
  return {
6188
6276
  id: this.id,
6189
6277
  };
@@ -6205,17 +6293,25 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6205
6293
  this.layout = layout;
6206
6294
  }
6207
6295
  fromJSON(panelData, group) {
6208
- var _a, _b, _c;
6296
+ var _a, _b, _c, _d;
6209
6297
  const panelId = panelData.id;
6210
6298
  const params = panelData.params;
6211
6299
  const title = panelData.title;
6212
6300
  const suppressClosable = panelData.suppressClosable;
6213
6301
  const viewData = panelData.view;
6302
+ let tab;
6303
+ if ((_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id) {
6304
+ tab = createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
6305
+ }
6306
+ else if (this.layout.options.defaultTabComponent) {
6307
+ tab = createComponent(this.layout.options.defaultTabComponent, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
6308
+ }
6309
+ else {
6310
+ tab = new DefaultTab();
6311
+ }
6214
6312
  const view = new DefaultGroupPanelView({
6215
- content: createComponent(viewData.content.id, viewData.content.id, this.layout.options.components, this.layout.options.frameworkComponents, (_a = this.layout.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content),
6216
- tab: ((_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id)
6217
- ? createComponent(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
6218
- : new DefaultTab(),
6313
+ content: createComponent(viewData.content.id, viewData.content.id, this.layout.options.components, this.layout.options.frameworkComponents, (_d = this.layout.options.frameworkComponentFactory) === null || _d === void 0 ? void 0 : _d.content),
6314
+ tab,
6219
6315
  });
6220
6316
  const panel = new DockviewGroupPanel(panelId, this.layout, new DockviewApi(this.layout), group);
6221
6317
  panel.init({
@@ -6283,6 +6379,80 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6283
6379
  }
6284
6380
  }
6285
6381
 
6382
+ class ReactGroupControlsRendererPart {
6383
+ constructor(component, reactPortalStore, _group) {
6384
+ this.component = component;
6385
+ this.reactPortalStore = reactPortalStore;
6386
+ this._group = _group;
6387
+ this.mutableDisposable = new MutableDisposable();
6388
+ this._element = document.createElement('div');
6389
+ this._element.className = 'dockview-react-part';
6390
+ }
6391
+ get element() {
6392
+ return this._element;
6393
+ }
6394
+ get part() {
6395
+ return this._part;
6396
+ }
6397
+ get group() {
6398
+ return this._group;
6399
+ }
6400
+ focus() {
6401
+ // TODO
6402
+ }
6403
+ init(parameters) {
6404
+ this.mutableDisposable.value = new CompositeDisposable(this._group.model.onDidAddPanel(() => {
6405
+ this.updatePanels();
6406
+ }), this._group.model.onDidRemovePanel(() => {
6407
+ this.updatePanels();
6408
+ }), this._group.model.onDidActivePanelChange(() => {
6409
+ this.updateActivePanel();
6410
+ }), parameters.api.onDidActiveChange(() => {
6411
+ this.updateGroupActive();
6412
+ }));
6413
+ this._part = new ReactPart(this.element, this.reactPortalStore, this.component, {
6414
+ api: parameters.api,
6415
+ containerApi: parameters.containerApi,
6416
+ panels: this._group.model.panels,
6417
+ activePanel: this._group.model.activePanel,
6418
+ isGroupActive: this._group.api.isActive,
6419
+ });
6420
+ }
6421
+ update(event) {
6422
+ var _a;
6423
+ (_a = this._part) === null || _a === void 0 ? void 0 : _a.update(event.params);
6424
+ }
6425
+ dispose() {
6426
+ var _a;
6427
+ this.mutableDisposable.dispose();
6428
+ (_a = this._part) === null || _a === void 0 ? void 0 : _a.dispose();
6429
+ }
6430
+ updatePanels() {
6431
+ this.update({ params: { panels: this._group.model.panels } });
6432
+ }
6433
+ updateActivePanel() {
6434
+ this.update({
6435
+ params: {
6436
+ activePanel: this._group.model.activePanel,
6437
+ },
6438
+ });
6439
+ }
6440
+ updateGroupActive() {
6441
+ this.update({
6442
+ params: {
6443
+ isGroupActive: this._group.api.isActive,
6444
+ },
6445
+ });
6446
+ }
6447
+ }
6448
+
6449
+ function createGroupControlElement(component, store) {
6450
+ return component
6451
+ ? (groupPanel) => {
6452
+ return new ReactGroupControlsRendererPart(component, store, groupPanel);
6453
+ }
6454
+ : undefined;
6455
+ }
6286
6456
  const DockviewReact = React__namespace.forwardRef((props, ref) => {
6287
6457
  const domRef = React__namespace.useRef(null);
6288
6458
  const dockviewRef = React__namespace.useRef();
@@ -6332,12 +6502,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6332
6502
  const dockview = new DockviewComponent(element, {
6333
6503
  frameworkComponentFactory: factory,
6334
6504
  frameworkComponents: props.components,
6335
- frameworkTabComponents: props.tabComponents,
6505
+ frameworkTabComponents: Object.assign(Object.assign({}, (props.tabComponents || {})), { [DEFAULT_TAB_IDENTIFIER]: props.defaultTabComponent }),
6336
6506
  tabHeight: props.tabHeight,
6337
6507
  watermarkFrameworkComponent: props.watermarkComponent,
6508
+ defaultTabComponent: DEFAULT_TAB_IDENTIFIER,
6338
6509
  styles: props.hideBorders
6339
6510
  ? { separatorBorder: 'transparent' }
6340
6511
  : undefined,
6512
+ showDndOverlay: props.showDndOverlay,
6513
+ createGroupControlElement: createGroupControlElement(props.groupControlComponent, { addPortal }),
6341
6514
  });
6342
6515
  (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
6343
6516
  dockview.deserializer = new ReactPanelDeserialzier(dockview);
@@ -6414,10 +6587,79 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6414
6587
  disposable.dispose();
6415
6588
  };
6416
6589
  }, [props.onTabContextMenu]);
6590
+ React__namespace.useEffect(() => {
6591
+ if (!dockviewRef.current) {
6592
+ return;
6593
+ }
6594
+ dockviewRef.current.updateOptions({
6595
+ defaultTabComponent: DEFAULT_TAB_IDENTIFIER,
6596
+ frameworkTabComponents: Object.assign(Object.assign({}, (props.tabComponents || {})), { [DEFAULT_TAB_IDENTIFIER]: props.defaultTabComponent }),
6597
+ });
6598
+ }, [props.defaultTabComponent]);
6599
+ React__namespace.useEffect(() => {
6600
+ if (!dockviewRef.current) {
6601
+ return;
6602
+ }
6603
+ dockviewRef.current.updateOptions({
6604
+ createGroupControlElement: createGroupControlElement(props.groupControlComponent, { addPortal }),
6605
+ });
6606
+ }, [props.groupControlComponent]);
6417
6607
  return (React__namespace.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
6418
6608
  });
6419
6609
  DockviewReact.displayName = 'DockviewComponent';
6420
6610
 
6611
+ /******************************************************************************
6612
+ Copyright (c) Microsoft Corporation.
6613
+
6614
+ Permission to use, copy, modify, and/or distribute this software for any
6615
+ purpose with or without fee is hereby granted.
6616
+
6617
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6618
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6619
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6620
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6621
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6622
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6623
+ PERFORMANCE OF THIS SOFTWARE.
6624
+ ***************************************************************************** */
6625
+
6626
+ function __rest(s, e) {
6627
+ var t = {};
6628
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
6629
+ t[p] = s[p];
6630
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6631
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
6632
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
6633
+ t[p[i]] = s[p[i]];
6634
+ }
6635
+ return t;
6636
+ }
6637
+
6638
+ const CloseButton = () => (React__namespace.createElement("svg", { height: "11", width: "11", viewBox: "0 0 28 28", "aria-hidden": 'false', focusable: false, className: "dockview-svg" },
6639
+ React__namespace.createElement("path", { d: "M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z" })));
6640
+
6641
+ const DockviewDefaultTab = (_a) => {
6642
+ var { api, containerApi: _containerApi, params: _params } = _a, rest = __rest(_a, ["api", "containerApi", "params"]);
6643
+ const onClose = React__namespace.useCallback((event) => {
6644
+ event.stopPropagation();
6645
+ api.close();
6646
+ }, [api]);
6647
+ const onClick = React__namespace.useCallback((event) => {
6648
+ api.setActive();
6649
+ if (rest.onClick) {
6650
+ rest.onClick(event);
6651
+ }
6652
+ }, [api, rest.onClick]);
6653
+ const iconClassname = React__namespace.useMemo(() => {
6654
+ const cn = ['dockview-react-tab-action'];
6655
+ return cn.join(',');
6656
+ }, [api.suppressClosable]);
6657
+ return (React__namespace.createElement("div", Object.assign({}, rest, { onClick: onClick, className: "dockview-react-tab" }),
6658
+ React__namespace.createElement("span", { className: "dockview-react-tab-title" }, api.title),
6659
+ React__namespace.createElement("div", { className: iconClassname, onClick: onClose },
6660
+ React__namespace.createElement(CloseButton, null))));
6661
+ };
6662
+
6421
6663
  class ReactPanelView extends SplitviewPanel {
6422
6664
  constructor(id, component, reactComponent, reactPortalStore) {
6423
6665
  super(id, component);
@@ -6647,6 +6889,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6647
6889
  createComponent,
6648
6890
  },
6649
6891
  },
6892
+ showDndOverlay: props.showDndOverlay,
6650
6893
  });
6651
6894
  const api = new PaneviewApi(paneview);
6652
6895
  const { clientWidth, clientHeight } = domRef.current;
@@ -6691,6 +6934,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6691
6934
  disposable.dispose();
6692
6935
  };
6693
6936
  }, [props.onDidDrop]);
6937
+ React__namespace.useEffect(() => {
6938
+ if (!paneviewRef.current) {
6939
+ return;
6940
+ }
6941
+ paneviewRef.current.updateOptions({
6942
+ showDndOverlay: props.showDndOverlay,
6943
+ });
6944
+ }, [props.showDndOverlay]);
6694
6945
  return (React__namespace.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
6695
6946
  });
6696
6947
  PaneviewReact.displayName = 'PaneviewComponent';
@@ -6699,6 +6950,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6699
6950
  exports.ContentContainer = ContentContainer;
6700
6951
  exports.DockviewApi = DockviewApi;
6701
6952
  exports.DockviewComponent = DockviewComponent;
6953
+ exports.DockviewDefaultTab = DockviewDefaultTab;
6702
6954
  exports.DockviewReact = DockviewReact;
6703
6955
  exports.Gridview = Gridview;
6704
6956
  exports.GridviewApi = GridviewApi;
@@ -6715,8 +6967,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6715
6967
  exports.PaneviewComponent = PaneviewComponent;
6716
6968
  exports.PaneviewPanel = PaneviewPanel;
6717
6969
  exports.PaneviewReact = PaneviewReact;
6718
- exports.ReactPanelContentPart = ReactPanelContentPart;
6719
- exports.ReactPanelHeaderPart = ReactPanelHeaderPart;
6720
6970
  exports.ReactPart = ReactPart;
6721
6971
  exports.ReactPartContext = ReactPartContext;
6722
6972
  exports.Splitview = Splitview;