dockview 1.4.0 → 1.4.3

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 (141) hide show
  1. package/README.md +4 -195
  2. package/dist/cjs/api/component.api.d.ts +8 -8
  3. package/dist/cjs/api/component.api.js +16 -19
  4. package/dist/cjs/api/component.api.js.map +1 -1
  5. package/dist/cjs/api/panelApi.d.ts +1 -2
  6. package/dist/cjs/api/panelApi.js +3 -3
  7. package/dist/cjs/api/panelApi.js.map +1 -1
  8. package/dist/cjs/dnd/droptarget.d.ts +1 -2
  9. package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -17
  10. package/dist/cjs/dockview/components/tab/defaultTab.js +9 -64
  11. package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
  12. package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -2
  13. package/dist/cjs/dockview/defaultGroupPanelView.js +2 -4
  14. package/dist/cjs/dockview/defaultGroupPanelView.js.map +1 -1
  15. package/dist/cjs/dockview/deserializer.d.ts +0 -12
  16. package/dist/cjs/dockview/deserializer.js +0 -52
  17. package/dist/cjs/dockview/deserializer.js.map +1 -1
  18. package/dist/cjs/dockview/dockviewComponent.d.ts +5 -7
  19. package/dist/cjs/dockview/dockviewComponent.js +79 -42
  20. package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
  21. package/dist/cjs/dockview/dockviewGroupPanel.js +1 -1
  22. package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
  23. package/dist/cjs/dockview/options.d.ts +6 -1
  24. package/dist/cjs/gridview/baseComponentGridview.d.ts +4 -2
  25. package/dist/cjs/gridview/baseComponentGridview.js +1 -1
  26. package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
  27. package/dist/cjs/gridview/basePanelView.js +1 -1
  28. package/dist/cjs/gridview/basePanelView.js.map +1 -1
  29. package/dist/cjs/gridview/gridview.js +1 -1
  30. package/dist/cjs/gridview/gridview.js.map +1 -1
  31. package/dist/cjs/gridview/gridviewComponent.d.ts +1 -2
  32. package/dist/cjs/gridview/gridviewComponent.js +28 -24
  33. package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
  34. package/dist/cjs/gridview/gridviewPanel.d.ts +2 -3
  35. package/dist/cjs/gridview/gridviewPanel.js +4 -4
  36. package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
  37. package/dist/cjs/groupview/groupview.d.ts +4 -3
  38. package/dist/cjs/groupview/groupview.js +20 -8
  39. package/dist/cjs/groupview/groupview.js.map +1 -1
  40. package/dist/cjs/groupview/groupviewPanel.d.ts +2 -2
  41. package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
  42. package/dist/cjs/groupview/tab.js +1 -0
  43. package/dist/cjs/groupview/tab.js.map +1 -1
  44. package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +3 -5
  45. package/dist/cjs/groupview/titlebar/tabsContainer.js +2 -4
  46. package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
  47. package/dist/cjs/groupview/types.d.ts +1 -3
  48. package/dist/cjs/index.d.ts +1 -0
  49. package/dist/cjs/index.js +1 -0
  50. package/dist/cjs/index.js.map +1 -1
  51. package/dist/cjs/paneview/defaultPaneviewHeader.js +6 -4
  52. package/dist/cjs/paneview/defaultPaneviewHeader.js.map +1 -1
  53. package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
  54. package/dist/cjs/paneview/paneviewComponent.js +20 -17
  55. package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
  56. package/dist/cjs/react/dockview/dockview.d.ts +2 -3
  57. package/dist/cjs/react/dockview/dockview.js.map +1 -1
  58. package/dist/cjs/react/dockview/reactContentPart.d.ts +2 -4
  59. package/dist/cjs/react/dockview/reactContentPart.js +0 -3
  60. package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
  61. package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +0 -1
  62. package/dist/cjs/react/dockview/v2/reactContentRenderer.js +0 -3
  63. package/dist/cjs/react/dockview/v2/reactContentRenderer.js.map +1 -1
  64. package/dist/cjs/react/gridview/view.js +2 -2
  65. package/dist/cjs/react/gridview/view.js.map +1 -1
  66. package/dist/cjs/react/index.d.ts +0 -1
  67. package/dist/cjs/react/index.js +0 -1
  68. package/dist/cjs/react/index.js.map +1 -1
  69. package/dist/cjs/react/splitview/view.js +2 -2
  70. package/dist/cjs/react/splitview/view.js.map +1 -1
  71. package/dist/cjs/splitview/core/options.d.ts +2 -2
  72. package/dist/cjs/splitview/splitviewComponent.d.ts +2 -1
  73. package/dist/cjs/splitview/splitviewComponent.js +23 -21
  74. package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
  75. package/dist/cjs/splitview/splitviewPanel.js +4 -6
  76. package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
  77. package/dist/dockview.amd.js +165 -250
  78. package/dist/dockview.amd.min.js +2 -2
  79. package/dist/dockview.amd.min.noStyle.js +2 -2
  80. package/dist/dockview.amd.noStyle.js +164 -249
  81. package/dist/dockview.cjs.js +165 -250
  82. package/dist/dockview.esm.js +160 -244
  83. package/dist/dockview.esm.min.js +2 -2
  84. package/dist/dockview.js +165 -250
  85. package/dist/dockview.min.js +2 -2
  86. package/dist/dockview.min.noStyle.js +2 -2
  87. package/dist/dockview.noStyle.js +164 -249
  88. package/dist/esm/api/component.api.d.ts +8 -8
  89. package/dist/esm/api/component.api.js +16 -19
  90. package/dist/esm/api/panelApi.d.ts +1 -2
  91. package/dist/esm/api/panelApi.js +3 -3
  92. package/dist/esm/dnd/droptarget.d.ts +1 -2
  93. package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -17
  94. package/dist/esm/dockview/components/tab/defaultTab.js +8 -49
  95. package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -2
  96. package/dist/esm/dockview/defaultGroupPanelView.js +3 -5
  97. package/dist/esm/dockview/deserializer.d.ts +0 -12
  98. package/dist/esm/dockview/deserializer.js +1 -27
  99. package/dist/esm/dockview/dockviewComponent.d.ts +5 -7
  100. package/dist/esm/dockview/dockviewComponent.js +50 -24
  101. package/dist/esm/dockview/dockviewGroupPanel.js +1 -1
  102. package/dist/esm/dockview/options.d.ts +6 -1
  103. package/dist/esm/gridview/baseComponentGridview.d.ts +4 -2
  104. package/dist/esm/gridview/baseComponentGridview.js +1 -1
  105. package/dist/esm/gridview/basePanelView.js +1 -1
  106. package/dist/esm/gridview/gridviewComponent.d.ts +1 -2
  107. package/dist/esm/gridview/gridviewComponent.js +17 -13
  108. package/dist/esm/gridview/gridviewPanel.d.ts +2 -3
  109. package/dist/esm/gridview/gridviewPanel.js +4 -4
  110. package/dist/esm/groupview/groupview.d.ts +4 -3
  111. package/dist/esm/groupview/groupview.js +19 -8
  112. package/dist/esm/groupview/groupviewPanel.d.ts +2 -2
  113. package/dist/esm/groupview/tab.js +1 -0
  114. package/dist/esm/groupview/titlebar/tabsContainer.d.ts +3 -5
  115. package/dist/esm/groupview/titlebar/tabsContainer.js +2 -4
  116. package/dist/esm/groupview/types.d.ts +1 -3
  117. package/dist/esm/index.d.ts +1 -0
  118. package/dist/esm/index.js +1 -0
  119. package/dist/esm/paneview/defaultPaneviewHeader.js +6 -4
  120. package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
  121. package/dist/esm/paneview/paneviewComponent.js +8 -5
  122. package/dist/esm/react/dockview/dockview.d.ts +2 -3
  123. package/dist/esm/react/dockview/reactContentPart.d.ts +2 -4
  124. package/dist/esm/react/dockview/reactContentPart.js +0 -3
  125. package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +0 -1
  126. package/dist/esm/react/dockview/v2/reactContentRenderer.js +0 -3
  127. package/dist/esm/react/gridview/view.js +2 -2
  128. package/dist/esm/react/index.d.ts +0 -1
  129. package/dist/esm/react/index.js +0 -1
  130. package/dist/esm/react/splitview/view.js +2 -2
  131. package/dist/esm/splitview/core/options.d.ts +2 -2
  132. package/dist/esm/splitview/splitviewComponent.d.ts +2 -1
  133. package/dist/esm/splitview/splitviewComponent.js +11 -9
  134. package/dist/esm/splitview/splitviewPanel.js +4 -6
  135. package/dist/styles/dockview.css +5 -0
  136. package/package.json +2 -2
  137. package/dist/cjs/react/dockview/components.d.ts +0 -11
  138. package/dist/cjs/react/dockview/components.js +0 -81
  139. package/dist/cjs/react/dockview/components.js.map +0 -1
  140. package/dist/esm/react/dockview/components.d.ts +0 -11
  141. package/dist/esm/react/dockview/components.js +0 -54
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.4.0
3
+ * @version 1.4.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2273,18 +2273,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2273
2273
  removePanel(panel, sizing) {
2274
2274
  this.component.removePanel(panel, sizing);
2275
2275
  }
2276
- setVisible(panel, isVisible) {
2277
- this.component.setVisible(panel, isVisible);
2278
- }
2279
2276
  focus() {
2280
2277
  this.component.focus();
2281
2278
  }
2282
2279
  getPanel(id) {
2283
2280
  return this.component.getPanel(id);
2284
2281
  }
2285
- setActive(panel) {
2286
- this.component.setActive(panel);
2287
- }
2288
2282
  layout(width, height) {
2289
2283
  return this.component.layout(width, height);
2290
2284
  }
@@ -2300,6 +2294,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2300
2294
  toJSON() {
2301
2295
  return this.component.toJSON();
2302
2296
  }
2297
+ clear() {
2298
+ this.component.clear();
2299
+ }
2303
2300
  }
2304
2301
  class PaneviewApi {
2305
2302
  constructor(component) {
@@ -2367,6 +2364,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2367
2364
  toJSON() {
2368
2365
  return this.component.toJSON();
2369
2366
  }
2367
+ clear() {
2368
+ this.component.clear();
2369
+ }
2370
2370
  }
2371
2371
  class GridviewApi {
2372
2372
  constructor(component) {
@@ -2393,13 +2393,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2393
2393
  get onDidLayoutChange() {
2394
2394
  return this.component.onDidLayoutChange;
2395
2395
  }
2396
- get onDidAddGroup() {
2396
+ get onDidAddPanel() {
2397
2397
  return this.component.onDidAddGroup;
2398
2398
  }
2399
- get onDidRemoveGroup() {
2399
+ get onDidRemovePanel() {
2400
2400
  return this.component.onDidRemoveGroup;
2401
2401
  }
2402
- get onDidActiveGroupChange() {
2402
+ get onDidActivePanelChange() {
2403
2403
  return this.component.onDidActiveGroupChange;
2404
2404
  }
2405
2405
  get onDidLayoutFromJSON() {
@@ -2432,21 +2432,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2432
2432
  getPanel(id) {
2433
2433
  return this.component.getPanel(id);
2434
2434
  }
2435
- toggleVisibility(panel) {
2436
- this.component.toggleVisibility(panel);
2437
- }
2438
- setVisible(panel, visible) {
2439
- this.component.setVisible(panel, visible);
2440
- }
2441
- setActive(panel) {
2442
- this.component.setActive(panel);
2443
- }
2444
2435
  fromJSON(data) {
2445
2436
  return this.component.fromJSON(data);
2446
2437
  }
2447
2438
  toJSON() {
2448
2439
  return this.component.toJSON();
2449
2440
  }
2441
+ clear() {
2442
+ this.component.clear();
2443
+ }
2450
2444
  }
2451
2445
  class DockviewApi {
2452
2446
  constructor(component) {
@@ -2495,7 +2489,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2495
2489
  return this.component.onDidRemovePanel;
2496
2490
  }
2497
2491
  get onDidLayoutFromJSON() {
2498
- return this.component.onDidLayoutfromJSON;
2492
+ return this.component.onDidLayoutFromJSON;
2499
2493
  }
2500
2494
  get onDidLayoutChange() {
2501
2495
  return this.component.onDidLayoutChange;
@@ -2557,6 +2551,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2557
2551
  toJSON() {
2558
2552
  return this.component.toJSON();
2559
2553
  }
2554
+ clear() {
2555
+ this.component.clear();
2556
+ }
2560
2557
  }
2561
2558
 
2562
2559
  class ContentContainer extends CompositeDisposable {
@@ -2630,12 +2627,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2630
2627
  }
2631
2628
  }
2632
2629
 
2633
- var DockviewDropTargets;
2630
+ exports.DockviewDropTargets = void 0;
2634
2631
  (function (DockviewDropTargets) {
2635
2632
  DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
2636
2633
  DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
2637
2634
  DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
2638
- })(DockviewDropTargets || (DockviewDropTargets = {}));
2635
+ })(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
2639
2636
 
2640
2637
  class DragHandler extends CompositeDisposable {
2641
2638
  constructor(el) {
@@ -2677,7 +2674,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2677
2674
  MouseEventKind["CLICK"] = "CLICK";
2678
2675
  MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
2679
2676
  })(exports.MouseEventKind || (exports.MouseEventKind = {}));
2680
- class Tab$1 extends CompositeDisposable {
2677
+ class Tab extends CompositeDisposable {
2681
2678
  constructor(panelId, accessor, group) {
2682
2679
  super();
2683
2680
  this.panelId = panelId;
@@ -2691,6 +2688,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2691
2688
  this._element.className = 'tab';
2692
2689
  this._element.tabIndex = 0;
2693
2690
  this._element.draggable = true;
2691
+ toggleClass(this.element, 'inactive-tab', true);
2694
2692
  this.addDisposables(new (class Handler extends DragHandler {
2695
2693
  constructor() {
2696
2694
  super(...arguments);
@@ -2733,7 +2731,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2733
2731
  if (data) {
2734
2732
  return this.panelId !== data.panelId;
2735
2733
  }
2736
- return this.group.model.canDisplayOverlay(event, DockviewDropTargets.Tab);
2734
+ return this.group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Tab);
2737
2735
  },
2738
2736
  });
2739
2737
  this.addDisposables(this.droptarget.onDrop((event) => {
@@ -2767,7 +2765,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2767
2765
  this.group = group;
2768
2766
  this.tabs = [];
2769
2767
  this.selectedIndex = -1;
2770
- this.active = false;
2771
2768
  this._hidden = false;
2772
2769
  this._onDrop = new Emitter();
2773
2770
  this.onDrop = this._onDrop.event;
@@ -2793,7 +2790,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2793
2790
  // don't show the overlay if the tab being dragged is the last panel of this group
2794
2791
  return ((_a = last(this.tabs)) === null || _a === void 0 ? void 0 : _a.value.panelId) !== data.panelId;
2795
2792
  }
2796
- return group.model.canDisplayOverlay(event, DockviewDropTargets.Panel);
2793
+ return group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2797
2794
  },
2798
2795
  });
2799
2796
  this.addDisposables(this.voidDropTarget.onDrop((event) => {
@@ -2871,8 +2868,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2871
2868
  indexOf(id) {
2872
2869
  return this.tabs.findIndex((tab) => tab.value.panelId === id);
2873
2870
  }
2874
- setActive(isGroupActive) {
2875
- this.active = isGroupActive;
2871
+ setActive(_isGroupActive) {
2872
+ // noop
2876
2873
  }
2877
2874
  addTab(tab, index = this.tabs.length) {
2878
2875
  if (index < 0 || index > this.tabs.length) {
@@ -2906,7 +2903,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2906
2903
  if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
2907
2904
  return;
2908
2905
  }
2909
- const tabToAdd = new Tab$1(panel.id, this.accessor, this.group);
2906
+ const tabToAdd = new Tab(panel.id, this.accessor, this.group);
2910
2907
  if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
2911
2908
  throw new Error('invalid header component');
2912
2909
  }
@@ -2933,7 +2930,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2933
2930
  }));
2934
2931
  const value = { value: tabToAdd, disposable };
2935
2932
  this.addTab(value, index);
2936
- this.activePanel = panel;
2937
2933
  }
2938
2934
  closePanel(panel) {
2939
2935
  this.delete(panel.id);
@@ -2992,7 +2988,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2992
2988
  const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
2993
2989
  return !groupHasOnePanelAndIsActiveDragElement;
2994
2990
  }
2995
- return this.canDisplayOverlay(event, DockviewDropTargets.Panel);
2991
+ return this.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2996
2992
  },
2997
2993
  });
2998
2994
  container.append(this.tabsContainer.element, this.contentContainer.element);
@@ -3150,16 +3146,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3150
3146
  options.index > this.panels.length) {
3151
3147
  options.index = this.panels.length;
3152
3148
  }
3153
- const skipSetActive = !!options.skipSetActive;
3149
+ const skipSetPanelActive = !!options.skipSetPanelActive;
3150
+ const skipSetGroupActive = !!options.skipSetGroupActive;
3154
3151
  // ensure the group is updated before we fire any events
3155
3152
  panel.updateParentGroup(this.parent, true);
3156
- if (!skipSetActive && this._activePanel === panel) {
3157
- this.accessor.doSetGroupActive(this.parent);
3153
+ if (this._activePanel === panel) {
3154
+ if (!skipSetGroupActive) {
3155
+ this.accessor.doSetGroupActive(this.parent);
3156
+ }
3158
3157
  return;
3159
3158
  }
3160
- this.doAddPanel(panel, options.index);
3161
- if (!skipSetActive) {
3159
+ this.doAddPanel(panel, options.index, skipSetPanelActive);
3160
+ if (!skipSetPanelActive) {
3162
3161
  this.doSetActivePanel(panel);
3162
+ }
3163
+ if (!skipSetGroupActive) {
3163
3164
  this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
3164
3165
  }
3165
3166
  this.updateContainer();
@@ -3263,11 +3264,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3263
3264
  panel,
3264
3265
  });
3265
3266
  }
3266
- doAddPanel(panel, index = this.panels.length) {
3267
+ doAddPanel(panel, index = this.panels.length, skipSetActive = false) {
3267
3268
  const existingPanel = this._panels.indexOf(panel);
3268
3269
  const hasExistingPanel = existingPanel > -1;
3269
3270
  this.tabsContainer.openPanel(panel, index);
3270
- this.contentContainer.openPanel(panel);
3271
+ if (!skipSetActive) {
3272
+ this.contentContainer.openPanel(panel);
3273
+ }
3271
3274
  this.tabsContainer.show();
3272
3275
  this.contentContainer.show();
3273
3276
  if (hasExistingPanel) {
@@ -3333,7 +3336,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3333
3336
  canDisplayOverlay(event, target) {
3334
3337
  // custom overlay handler
3335
3338
  if (this.accessor.options.showDndOverlay) {
3336
- return this.accessor.options.showDndOverlay(event, target);
3339
+ return this.accessor.options.showDndOverlay({
3340
+ nativeEvent: event,
3341
+ target,
3342
+ group: this.accessor.getPanel(this.id),
3343
+ });
3337
3344
  }
3338
3345
  return false;
3339
3346
  }
@@ -3416,7 +3423,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3416
3423
  this.element.appendChild(this.gridview.element);
3417
3424
  this.layout(0, 0, true); // set some elements height/widths
3418
3425
  this.addDisposables(this.gridview.onDidChange(() => {
3419
- this._onDidLayoutChange.fire();
3426
+ this._bufferOnDidLayoutChange.fire();
3420
3427
  }));
3421
3428
  this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
3422
3429
  this._bufferOnDidLayoutChange.fire();
@@ -3577,10 +3584,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3577
3584
  this._isVisible = true;
3578
3585
  this._width = 0;
3579
3586
  this._height = 0;
3580
- this._onDidPanelDimensionChange = new Emitter({
3587
+ this._onDidDimensionChange = new Emitter({
3581
3588
  replay: true,
3582
3589
  });
3583
- this.onDidDimensionsChange = this._onDidPanelDimensionChange.event;
3590
+ this.onDidDimensionsChange = this._onDidDimensionChange.event;
3584
3591
  //
3585
3592
  this._onDidChangeFocus = new Emitter({
3586
3593
  replay: true,
@@ -3605,7 +3612,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3605
3612
  //
3606
3613
  this._onActiveChange = new Emitter();
3607
3614
  this.onActiveChange = this._onActiveChange.event;
3608
- this.addDisposables(this._onDidPanelDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
3615
+ this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
3609
3616
  this._isFocused = event.isFocused;
3610
3617
  }), this.onDidActiveChange((event) => {
3611
3618
  this._isActive = event.isActive;
@@ -3829,7 +3836,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3829
3836
  layout(width, height) {
3830
3837
  var _a;
3831
3838
  // the obtain the correct dimensions of the content panel we must deduct the tab height
3832
- this.api._onDidPanelDimensionChange.fire({
3839
+ this.api._onDidDimensionChange.fire({
3833
3840
  width,
3834
3841
  height: height - (this.group.model.header.height || 0),
3835
3842
  });
@@ -3926,34 +3933,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3926
3933
  }
3927
3934
  }
3928
3935
 
3929
- class DefaultDeserializer {
3930
- constructor(layout, panelDeserializer) {
3931
- this.layout = layout;
3932
- this.panelDeserializer = panelDeserializer;
3933
- }
3934
- fromJSON(node) {
3935
- const data = node.data;
3936
- const children = data.views;
3937
- const active = data.activeView;
3938
- const group = this.layout.createGroup({
3939
- id: data.id,
3940
- locked: !!data.locked,
3941
- hideHeader: !!data.hideHeader,
3942
- });
3943
- for (const child of children) {
3944
- const panel = this.panelDeserializer.createPanel(child, group);
3945
- const isActive = typeof active === 'string' && active === panel.id;
3946
- group.model.openPanel(panel, {
3947
- skipSetActive: !isActive,
3948
- });
3949
- }
3950
- if (!group.activePanel && group.panels.length > 0) {
3951
- group.model.openPanel(group.panels[group.panels.length - 1]);
3952
- }
3953
- return group;
3954
- }
3955
- }
3956
-
3957
3936
  function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
3958
3937
  const Component = typeof componentName === 'string'
3959
3938
  ? components[componentName]
@@ -3979,53 +3958,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3979
3958
  return new Component(id, componentName);
3980
3959
  }
3981
3960
 
3982
- class WrappedTab {
3983
- constructor(renderer) {
3984
- this.renderer = renderer;
3985
- this._element = document.createElement('element');
3986
- this.show();
3987
- }
3988
- get innerRenderer() {
3989
- return this.renderer;
3990
- }
3991
- get element() {
3992
- return this._element;
3993
- }
3994
- get id() {
3995
- return this.renderer.id;
3996
- }
3997
- show() {
3998
- if (!this.renderer.element.parentElement) {
3999
- this._element.appendChild(this.renderer.element);
4000
- }
4001
- }
4002
- hide() {
4003
- if (this.renderer.element.parentElement) {
4004
- this.renderer.element.remove();
4005
- }
4006
- }
4007
- layout(width, height) {
4008
- this.renderer.layout(width, height);
4009
- }
4010
- update(event) {
4011
- this.renderer.update(event);
4012
- }
4013
- toJSON() {
4014
- return this.renderer.toJSON();
4015
- }
4016
- focus() {
4017
- this.renderer.focus();
4018
- }
4019
- init(parameters) {
4020
- this.renderer.init(parameters);
4021
- }
4022
- updateParentGroup(group, isPanelVisible) {
4023
- this.renderer.updateParentGroup(group, isPanelVisible);
4024
- }
4025
- dispose() {
4026
- this.renderer.dispose();
4027
- }
4028
- }
4029
3961
  class DefaultTab extends CompositeDisposable {
4030
3962
  constructor() {
4031
3963
  super();
@@ -4088,15 +4020,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4088
4020
  }
4089
4021
  }
4090
4022
  updateParentGroup(group, isPanelVisible) {
4023
+ const changed = this._isPanelVisible !== isPanelVisible ||
4024
+ this._isGroupActive !== group.isActive;
4091
4025
  this._isPanelVisible = isPanelVisible;
4092
4026
  this._isGroupActive = group.isActive;
4093
- this.render();
4027
+ if (changed) {
4028
+ this.render();
4029
+ }
4094
4030
  }
4095
4031
  layout(_width, _height) {
4096
4032
  // noop
4097
4033
  }
4098
4034
  render() {
4099
- this._content.textContent = this.params.title;
4035
+ if (this._content.textContent !== this.params.title) {
4036
+ this._content.textContent = this.params.title;
4037
+ }
4100
4038
  }
4101
4039
  }
4102
4040
 
@@ -4140,7 +4078,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4140
4078
  layout(width, height) {
4141
4079
  this._width = width;
4142
4080
  this._height = height;
4143
- this.api._onDidPanelDimensionChange.fire({ width, height });
4081
+ this.api._onDidDimensionChange.fire({ width, height });
4144
4082
  if (this.part) {
4145
4083
  if (this._params) {
4146
4084
  this.part.update(this._params.params);
@@ -4189,11 +4127,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4189
4127
  this.onDidChange = this._onDidChange.event;
4190
4128
  this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
4191
4129
  const { isVisible } = event;
4192
- const { containerApi } = this._params;
4193
- containerApi.setVisible(this, isVisible);
4130
+ const { accessor } = this._params;
4131
+ accessor.setVisible(this, isVisible);
4194
4132
  }), this.api.onActiveChange(() => {
4195
- const { containerApi } = this._params;
4196
- containerApi.setActive(this);
4133
+ const { accessor } = this._params;
4134
+ accessor.setActive(this);
4197
4135
  }), this.api.onDidConstraintsChangeInternal((event) => {
4198
4136
  if (typeof event.minimumWidth === 'number' ||
4199
4137
  typeof event.minimumWidth === 'function') {
@@ -4372,7 +4310,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4372
4310
  constructor(renderers) {
4373
4311
  var _a;
4374
4312
  this._content = renderers.content;
4375
- this._tab = new WrappedTab((_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab());
4313
+ this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
4376
4314
  this._actions =
4377
4315
  renderers.actions ||
4378
4316
  (this.content.actions
@@ -4412,9 +4350,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4412
4350
  toJSON() {
4413
4351
  return {
4414
4352
  content: this.content.toJSON(),
4415
- tab: this.tab.innerRenderer instanceof DefaultTab
4416
- ? undefined
4417
- : this.tab.toJSON(),
4353
+ tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
4418
4354
  };
4419
4355
  }
4420
4356
  dispose() {
@@ -4433,9 +4369,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4433
4369
  orientation: options.orientation || exports.Orientation.HORIZONTAL,
4434
4370
  styles: options.styles,
4435
4371
  });
4436
- // events
4437
- this._onTabInteractionEvent = new Emitter();
4438
- this.onTabInteractionEvent = this._onTabInteractionEvent.event;
4439
4372
  this._onTabContextMenu = new Emitter();
4440
4373
  this.onTabContextMenu = this._onTabContextMenu.event;
4441
4374
  this._onDidDrop = new Emitter();
@@ -4444,11 +4377,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4444
4377
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4445
4378
  this._onDidAddPanel = new Emitter();
4446
4379
  this.onDidAddPanel = this._onDidAddPanel.event;
4447
- this._onDidLayoutfromJSON = new Emitter();
4448
- this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
4380
+ this._onDidLayoutFromJSON = new Emitter();
4381
+ this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
4449
4382
  this._onDidActivePanelChange = new Emitter();
4450
4383
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
4451
- this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4384
+ this.addDisposables(this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4452
4385
  this._bufferOnDidLayoutChange.fire();
4453
4386
  }));
4454
4387
  this._options = options;
@@ -4503,7 +4436,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4503
4436
  }
4504
4437
  updateOptions(options) {
4505
4438
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4506
- this.options.orientation !== options.orientation;
4439
+ this.gridview.orientation !== options.orientation;
4507
4440
  this._options = Object.assign(Object.assign({}, this.options), options);
4508
4441
  if (hasOrientationChanged) {
4509
4442
  this.gridview.orientation = options.orientation;
@@ -4581,12 +4514,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4581
4514
  };
4582
4515
  }
4583
4516
  fromJSON(data) {
4584
- const groups = Array.from(this._groups.values()).map((_) => _.value);
4585
- for (const group of groups) {
4586
- // remove the group will automatically remove the panels
4587
- this.removeGroup(group, true);
4588
- }
4589
- this.gridview.clear();
4517
+ this.clear();
4590
4518
  if (!this.deserializer) {
4591
4519
  throw new Error('invalid deserializer');
4592
4520
  }
@@ -4597,12 +4525,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4597
4525
  if (!this.deserializer) {
4598
4526
  throw new Error('no deserializer provided');
4599
4527
  }
4600
- this.gridview.deserialize(grid, new DefaultDeserializer(this, {
4601
- createPanel: (id, group) => {
4602
- const panelData = panels[id];
4603
- return this.deserializer.fromJSON(panelData, group);
4604
- },
4605
- }));
4528
+ this.gridview.deserialize(grid, {
4529
+ fromJSON: (node) => {
4530
+ const { id, locked, hideHeader, views, activeView } = node.data;
4531
+ const group = this.createGroup({
4532
+ id,
4533
+ locked: !!locked,
4534
+ hideHeader: !!hideHeader,
4535
+ });
4536
+ this._onDidAddGroup.fire(group);
4537
+ for (const child of views) {
4538
+ const panel = this.deserializer.fromJSON(panels[child], group);
4539
+ const isActive = typeof activeView === 'string' && activeView === panel.id;
4540
+ group.model.openPanel(panel, {
4541
+ skipSetPanelActive: !isActive,
4542
+ skipSetGroupActive: true
4543
+ });
4544
+ }
4545
+ if (!group.activePanel && group.panels.length > 0) {
4546
+ group.model.openPanel(group.panels[group.panels.length - 1], {
4547
+ skipSetGroupActive: true
4548
+ });
4549
+ }
4550
+ return group;
4551
+ }
4552
+ });
4606
4553
  if (typeof activeGroup === 'string') {
4607
4554
  const panel = this.getPanel(activeGroup);
4608
4555
  if (panel) {
@@ -4610,7 +4557,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4610
4557
  }
4611
4558
  }
4612
4559
  this.gridview.layout(this.width, this.height);
4613
- this._onDidLayoutfromJSON.fire();
4560
+ this._onDidLayoutFromJSON.fire();
4561
+ }
4562
+ clear() {
4563
+ const groups = Array.from(this._groups.values()).map((_) => _.value);
4564
+ const hasActiveGroup = !!this.activeGroup;
4565
+ const hasActivePanel = !!this.activePanel;
4566
+ for (const group of groups) {
4567
+ // remove the group will automatically remove the panels
4568
+ this.removeGroup(group, true);
4569
+ }
4570
+ if (hasActiveGroup) {
4571
+ this.doSetGroupActive(undefined);
4572
+ }
4573
+ if (hasActivePanel) {
4574
+ this._onDidActivePanelChange.fire(undefined);
4575
+ }
4576
+ this.gridview.clear();
4614
4577
  }
4615
4578
  closeAllGroups() {
4616
4579
  for (const entry of this._groups.entries()) {
@@ -4802,13 +4765,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4802
4765
  }
4803
4766
  }
4804
4767
  const view = new GroupPanel(this, id, options);
4805
- view.init({ params: {}, containerApi: null }); // required to initialized .part and allow for correct disposal of group
4768
+ view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
4806
4769
  if (!this._groups.has(view.id)) {
4807
4770
  const disposable = new CompositeDisposable(view.model.onMove((event) => {
4808
4771
  const { groupId, itemId, target, index } = event;
4809
4772
  this.moveGroupOrPanel(view, groupId, itemId, target, index);
4810
4773
  }), view.model.onDidDrop((event) => {
4811
- this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
4774
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: view }));
4812
4775
  }), view.model.onDidGroupChange((event) => {
4813
4776
  switch (event.kind) {
4814
4777
  case exports.GroupChangeKind2.ADD_PANEL:
@@ -4872,7 +4835,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4872
4835
  this._onDidActivePanelChange.dispose();
4873
4836
  this._onDidAddPanel.dispose();
4874
4837
  this._onDidRemovePanel.dispose();
4875
- this._onDidLayoutfromJSON.dispose();
4838
+ this._onDidLayoutFromJSON.dispose();
4876
4839
  }
4877
4840
  }
4878
4841
 
@@ -4910,7 +4873,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4910
4873
  }
4911
4874
  updateOptions(options) {
4912
4875
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4913
- this.options.orientation !== options.orientation;
4876
+ this.gridview.orientation !== options.orientation;
4914
4877
  this._options = Object.assign(Object.assign({}, this.options), options);
4915
4878
  if (hasOrientationChanged) {
4916
4879
  this.gridview.orientation = options.orientation;
@@ -4941,21 +4904,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4941
4904
  value.value.setActive(panel === value.value);
4942
4905
  });
4943
4906
  }
4944
- toggleVisibility(panel) {
4945
- this.setVisible(panel, !this.isVisible(panel));
4946
- }
4947
4907
  focus() {
4948
4908
  var _a;
4949
4909
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
4950
4910
  }
4951
4911
  fromJSON(serializedGridview) {
4912
+ this.clear();
4952
4913
  const { grid, activePanel } = serializedGridview;
4953
- const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4954
- for (const group of groups) {
4955
- group.disposable.dispose();
4956
- this.doRemoveGroup(group.value, { skipActive: true });
4957
- }
4958
- this.gridview.clear();
4959
4914
  const queue = [];
4960
4915
  this.gridview.deserialize(grid, {
4961
4916
  fromJSON: (node) => {
@@ -4974,9 +4929,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4974
4929
  maximumHeight: data.maximumHeight,
4975
4930
  priority: data.priority,
4976
4931
  snap: !!data.snap,
4977
- containerApi: new GridviewApi(this),
4932
+ accessor: this,
4978
4933
  isVisible: node.visible,
4979
4934
  }));
4935
+ this._onDidAddGroup.fire(view);
4980
4936
  this.registerPanel(view);
4981
4937
  return view;
4982
4938
  },
@@ -4991,6 +4947,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4991
4947
  }
4992
4948
  this._onDidLayoutfromJSON.fire();
4993
4949
  }
4950
+ clear() {
4951
+ const hasActiveGroup = this.activeGroup;
4952
+ const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4953
+ for (const group of groups) {
4954
+ group.disposable.dispose();
4955
+ this.doRemoveGroup(group.value, { skipActive: true });
4956
+ }
4957
+ if (hasActiveGroup) {
4958
+ this.doSetGroupActive(undefined);
4959
+ }
4960
+ this.gridview.clear();
4961
+ }
4994
4962
  movePanel(panel, options) {
4995
4963
  var _a;
4996
4964
  let relativeLocation;
@@ -5040,7 +5008,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5040
5008
  maximumHeight: options.maximumHeight,
5041
5009
  priority: options.priority,
5042
5010
  snap: !!options.snap,
5043
- containerApi: new GridviewApi(this),
5011
+ accessor: this,
5044
5012
  isVisible: true,
5045
5013
  });
5046
5014
  this.registerPanel(view);
@@ -5236,7 +5204,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5236
5204
  maximumSize: options.maximumSize,
5237
5205
  snap: options.snap,
5238
5206
  priority: options.priority,
5239
- containerApi: new SplitviewApi(this),
5207
+ accessor: this,
5240
5208
  });
5241
5209
  const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
5242
5210
  const index = typeof options.index === 'number' ? options.index : undefined;
@@ -5281,13 +5249,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5281
5249
  };
5282
5250
  }
5283
5251
  fromJSON(serializedSplitview) {
5252
+ this.clear();
5284
5253
  const { views, orientation, size, activeView } = serializedSplitview;
5285
- for (const [_, value] of this._panels.entries()) {
5286
- value.disposable.dispose();
5287
- value.value.dispose();
5288
- }
5289
- this._panels.clear();
5290
- this.splitview.dispose();
5291
5254
  const queue = [];
5292
5255
  this.splitview = new Splitview(this.element, {
5293
5256
  orientation,
@@ -5312,7 +5275,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5312
5275
  maximumSize: data.maximumSize,
5313
5276
  snap: view.snap,
5314
5277
  priority: view.priority,
5315
- containerApi: new SplitviewApi(this),
5278
+ accessor: this,
5316
5279
  });
5317
5280
  });
5318
5281
  panel.orientation = orientation;
@@ -5335,6 +5298,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5335
5298
  }
5336
5299
  this._onDidLayoutfromJSON.fire();
5337
5300
  }
5301
+ clear() {
5302
+ for (const [_, value] of this._panels.entries()) {
5303
+ value.disposable.dispose();
5304
+ value.value.dispose();
5305
+ }
5306
+ this._panels.clear();
5307
+ this.splitview.dispose();
5308
+ }
5338
5309
  dispose() {
5339
5310
  for (const [_, value] of this._panels.entries()) {
5340
5311
  value.disposable.dispose();
@@ -5663,9 +5634,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5663
5634
  this.element.className = 'default-header';
5664
5635
  this._content = document.createElement('span');
5665
5636
  this._expander = document.createElement('a');
5666
- this.element.appendChild(this._content);
5667
5637
  this.element.appendChild(this._expander);
5668
- this.addDisposables(addDisposableListener(this._expander, 'click', () => {
5638
+ this.element.appendChild(this._content);
5639
+ this.addDisposables(addDisposableListener(this._element, 'click', () => {
5669
5640
  var _a;
5670
5641
  (_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.setExpanded(!this.apiRef.api.isExpanded);
5671
5642
  }));
@@ -5676,9 +5647,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5676
5647
  init(params) {
5677
5648
  this.apiRef.api = params.api;
5678
5649
  this._content.textContent = params.title;
5679
- this._expander.textContent = params.api.isExpanded ? '<' : '>';
5650
+ this._expander.textContent = '';
5651
+ toggleClass(this._expander, 'collapsed', !params.api.isExpanded);
5680
5652
  this.disposable.value = params.api.onDidExpansionChange((e) => {
5681
- this._expander.textContent = e.isExpanded ? '<' : '>';
5653
+ toggleClass(this._expander, 'collapsed', !e.isExpanded);
5682
5654
  });
5683
5655
  }
5684
5656
  update(_params) {
@@ -5854,13 +5826,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5854
5826
  };
5855
5827
  }
5856
5828
  fromJSON(serializedPaneview) {
5829
+ this.clear();
5857
5830
  const { views, size } = serializedPaneview;
5858
5831
  const queue = [];
5859
- for (const [_, value] of this._viewDisposables.entries()) {
5860
- value.dispose();
5861
- }
5862
- this._viewDisposables.clear();
5863
- this.paneview.dispose();
5864
5832
  this.paneview = new Paneview(this.element, {
5865
5833
  orientation: exports.Orientation.VERTICAL,
5866
5834
  descriptor: {
@@ -5919,6 +5887,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5919
5887
  queue.forEach((f) => f());
5920
5888
  this._onDidLayoutfromJSON.fire();
5921
5889
  }
5890
+ clear() {
5891
+ for (const [_, value] of this._viewDisposables.entries()) {
5892
+ value.dispose();
5893
+ }
5894
+ this._viewDisposables.clear();
5895
+ this.paneview.dispose();
5896
+ }
5922
5897
  doAddPanel(panel) {
5923
5898
  const disposable = panel.onDidDrop((event) => {
5924
5899
  this._onDidDrop.fire(event);
@@ -5954,13 +5929,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5954
5929
  this.onDidChange = this._onDidChange.event;
5955
5930
  this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
5956
5931
  const { isVisible } = event;
5957
- const { containerApi } = this
5958
- ._params;
5959
- containerApi.setVisible(this, isVisible);
5932
+ const { accessor } = this._params;
5933
+ accessor.setVisible(this, isVisible);
5960
5934
  }), this.api.onActiveChange(() => {
5961
- const { containerApi } = this
5962
- ._params;
5963
- containerApi.setActive(this);
5935
+ const { accessor } = this._params;
5936
+ accessor.setActive(this);
5964
5937
  }), this.api.onDidConstraintsChangeInternal((event) => {
5965
5938
  if (typeof event.minimumSize === 'number' ||
5966
5939
  typeof event.minimumSize === 'function') {
@@ -6212,9 +6185,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6212
6185
  layout(_width, _height) {
6213
6186
  // noop
6214
6187
  }
6215
- close() {
6216
- return Promise.resolve(true);
6217
- }
6218
6188
  dispose() {
6219
6189
  var _a, _b;
6220
6190
  this._onDidFocus.dispose();
@@ -6484,58 +6454,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6484
6454
  });
6485
6455
  DockviewReact.displayName = 'DockviewComponent';
6486
6456
 
6487
- const Tab = (props) => {
6488
- return React__namespace.createElement(React__namespace.Fragment, null, props.children);
6489
- };
6490
- const Content = (props) => {
6491
- return React__namespace.createElement(React__namespace.Fragment, null, props.children);
6492
- };
6493
- const Actions = (props) => {
6494
- return React__namespace.createElement(React__namespace.Fragment, null, props.children);
6495
- };
6496
- function isValidComponent(element) {
6497
- return [Content, Actions, Tab].find((comp) => element.type === comp);
6498
- }
6499
- const Panel = (props) => {
6500
- const context = React__namespace.useContext(ReactPartContext);
6501
- const sections = React__namespace.useMemo(() => {
6502
- var _a;
6503
- const childs = ((_a = React__namespace.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
6504
- const isInvalid = !!childs.find((_) => !isValidComponent(_));
6505
- if (isInvalid) {
6506
- throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
6507
- }
6508
- const body = childs.find((_) => _.type === Content);
6509
- const actions = childs.find((_) => _.type === Actions);
6510
- const tab = childs.find((_) => _.type === Tab);
6511
- return { body, actions, tab };
6512
- }, [props.children]);
6513
- React__namespace.useEffect(() => {
6514
- /**
6515
- * hide or show the default tab behavior based on whether we want to override
6516
- * with our own React tab.
6517
- */
6518
- if (sections.tab) {
6519
- context.tabPortalElement.hide();
6520
- }
6521
- else {
6522
- context.tabPortalElement.show();
6523
- }
6524
- }, [sections.tab]);
6525
- return (React__namespace.createElement(React__namespace.Fragment, null,
6526
- sections.actions &&
6527
- ReactDOM__namespace.createPortal(sections.actions, context.actionsPortalElement),
6528
- sections.tab &&
6529
- ReactDOM__namespace.createPortal(sections.tab, context.tabPortalElement.element),
6530
- sections.body || props.children));
6531
- };
6532
- const DockviewComponents = {
6533
- Tab,
6534
- Content,
6535
- Actions,
6536
- Panel,
6537
- };
6538
-
6539
6457
  class ReactPanelView extends SplitviewPanel {
6540
6458
  constructor(id, component, reactComponent, reactPortalStore) {
6541
6459
  super(id, component);
@@ -6547,8 +6465,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6547
6465
  return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
6548
6466
  params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
6549
6467
  api: this.api,
6550
- containerApi: this._params
6551
- .containerApi,
6468
+ containerApi: new SplitviewApi(this._params.accessor),
6552
6469
  });
6553
6470
  }
6554
6471
  }
@@ -6624,8 +6541,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6624
6541
  return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
6625
6542
  params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
6626
6543
  api: this.api,
6627
- containerApi: this._params
6628
- .containerApi,
6544
+ containerApi: new GridviewApi(this._params.accessor),
6629
6545
  });
6630
6546
  }
6631
6547
  }
@@ -6819,7 +6735,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6819
6735
  exports.ContentContainer = ContentContainer;
6820
6736
  exports.DockviewApi = DockviewApi;
6821
6737
  exports.DockviewComponent = DockviewComponent;
6822
- exports.DockviewComponents = DockviewComponents;
6823
6738
  exports.DockviewReact = DockviewReact;
6824
6739
  exports.Gridview = Gridview;
6825
6740
  exports.GridviewApi = GridviewApi;
@@ -6845,7 +6760,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6845
6760
  exports.SplitviewComponent = SplitviewComponent;
6846
6761
  exports.SplitviewPanel = SplitviewPanel;
6847
6762
  exports.SplitviewReact = SplitviewReact;
6848
- exports.Tab = Tab$1;
6763
+ exports.Tab = Tab;
6849
6764
  exports.getDirectionOrientation = getDirectionOrientation;
6850
6765
  exports.getGridLocation = getGridLocation;
6851
6766
  exports.getLocationOrientation = getLocationOrientation;