dockview-core 8.4.1 → 8.5.1

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 8.4.1
3
+ * @version 8.5.1
4
4
  * @link https://github.com/dockview/dockview
5
5
  * @license MIT
6
6
  */
@@ -6069,24 +6069,25 @@ var ContentContainer = class extends CompositeDisposable {
6069
6069
  else this._element.removeAttribute("aria-labelledby");
6070
6070
  }
6071
6071
  renderPanel(panel, options) {
6072
- var _options$asActive, _this$panel;
6073
- const doRender = ((_options$asActive = options === null || options === void 0 ? void 0 : options.asActive) !== null && _options$asActive !== void 0 ? _options$asActive : true) || this.panel && this.group.isPanelActive(this.panel);
6074
- if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
6075
- var _this$panel$view$cont, _this$panel$view$cont2;
6076
- this.panel.view.content.element.remove();
6077
- (_this$panel$view$cont = (_this$panel$view$cont2 = this.panel.view.content).onHide) === null || _this$panel$view$cont === void 0 || _this$panel$view$cont.call(_this$panel$view$cont2);
6072
+ var _options$asActive;
6073
+ const doRender = ((_options$asActive = options === null || options === void 0 ? void 0 : options.asActive) !== null && _options$asActive !== void 0 ? _options$asActive : true) || this.group.isPanelActive(panel);
6074
+ if (doRender || this.panel === panel) {
6075
+ var _this$panel;
6076
+ if (((_this$panel = this.panel) === null || _this$panel === void 0 ? void 0 : _this$panel.view.content.element.parentElement) === this._element) {
6077
+ var _this$panel$view$cont, _this$panel$view$cont2;
6078
+ this.panel.view.content.element.remove();
6079
+ (_this$panel$view$cont = (_this$panel$view$cont2 = this.panel.view.content).onHide) === null || _this$panel$view$cont === void 0 || _this$panel$view$cont.call(_this$panel$view$cont2);
6080
+ }
6081
+ this.panel = panel;
6078
6082
  }
6079
- this.panel = panel;
6080
6083
  let container;
6081
6084
  switch (panel.api.renderer) {
6082
6085
  case "onlyWhenVisible":
6083
6086
  this.group.renderContainer.detatch(panel);
6084
- if (this.panel) {
6085
- if (doRender) {
6086
- var _this$panel$view$cont3, _this$panel$view$cont4;
6087
- this._element.appendChild(this.panel.view.content.element);
6088
- (_this$panel$view$cont3 = (_this$panel$view$cont4 = this.panel.view.content).onShow) === null || _this$panel$view$cont3 === void 0 || _this$panel$view$cont3.call(_this$panel$view$cont4);
6089
- }
6087
+ if (doRender) {
6088
+ var _panel$view$content$o, _panel$view$content;
6089
+ this._element.appendChild(panel.view.content.element);
6090
+ (_panel$view$content$o = (_panel$view$content = panel.view.content).onShow) === null || _panel$view$content$o === void 0 || _panel$view$content$o.call(_panel$view$content);
6090
6091
  }
6091
6092
  container = this._element;
6092
6093
  break;
@@ -6115,9 +6116,9 @@ var ContentContainer = class extends CompositeDisposable {
6115
6116
  closePanel() {
6116
6117
  if (this.panel) {
6117
6118
  if (this.panel.api.renderer === "onlyWhenVisible") {
6118
- var _this$panel$view$cont5, _this$panel$view$cont6;
6119
+ var _this$panel$view$cont3, _this$panel$view$cont4;
6119
6120
  this.panel.view.content.element.remove();
6120
- (_this$panel$view$cont5 = (_this$panel$view$cont6 = this.panel.view.content).onHide) === null || _this$panel$view$cont5 === void 0 || _this$panel$view$cont5.call(_this$panel$view$cont6);
6121
+ (_this$panel$view$cont3 = (_this$panel$view$cont4 = this.panel.view.content).onHide) === null || _this$panel$view$cont3 === void 0 || _this$panel$view$cont3.call(_this$panel$view$cont4);
6121
6122
  }
6122
6123
  }
6123
6124
  this.panel = void 0;
@@ -11150,7 +11151,6 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
11150
11151
  this.rerender(panel);
11151
11152
  });
11152
11153
  if (this._activePanel) {
11153
- this.contentContainer.renderPanel(this._activePanel, { asActive: true });
11154
11154
  const { width, height } = this.contentDimensions();
11155
11155
  this._activePanel.layout(width, height);
11156
11156
  }
@@ -15138,9 +15138,14 @@ var EdgeGroupView = class {
15138
15138
  get isCollapsed() {
15139
15139
  return this._isCollapsed;
15140
15140
  }
15141
+ /** Includes the gap share, as expanding restores a slot size. */
15141
15142
  get lastExpandedSize() {
15142
15143
  return this._lastExpandedSize;
15143
15144
  }
15145
+ /** Without the gap share. */
15146
+ get lastExpandedContentSize() {
15147
+ return this._lastExpandedSize - this._gapAdd;
15148
+ }
15144
15149
  get collapsedSize() {
15145
15150
  return this._effectiveBaseCollapsed + this._gapAdd;
15146
15151
  }
@@ -15204,7 +15209,7 @@ var EdgeGroupView = class {
15204
15209
  if (this._isCollapsed) this._onDidChange.fire({ size: this.collapsedSize });
15205
15210
  }
15206
15211
  layout(size, orthogonalSize) {
15207
- if (!this._isCollapsed) this._lastExpandedSize = size;
15212
+ if (!this._isCollapsed) this._lastExpandedSize = size + this._gapAdd;
15208
15213
  if (this._orientation === "horizontal") this._group.layout(size, orthogonalSize);
15209
15214
  else this._group.layout(orthogonalSize, size);
15210
15215
  }
@@ -15635,7 +15640,7 @@ var ShellManager = class {
15635
15640
  * the auto-hide peek overlay. */
15636
15641
  getEdgeGroupExpandedSize(position) {
15637
15642
  var _this$_getView$lastEx, _this$_getView2;
15638
- return (_this$_getView$lastEx = (_this$_getView2 = this._getView(position)) === null || _this$_getView2 === void 0 ? void 0 : _this$_getView2.lastExpandedSize) !== null && _this$_getView$lastEx !== void 0 ? _this$_getView$lastEx : 0;
15643
+ return (_this$_getView$lastEx = (_this$_getView2 = this._getView(position)) === null || _this$_getView2 === void 0 ? void 0 : _this$_getView2.lastExpandedContentSize) !== null && _this$_getView$lastEx !== void 0 ? _this$_getView$lastEx : 0;
15639
15644
  }
15640
15645
  _getView(position) {
15641
15646
  switch (position) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview-core",
3
- "version": "8.4.1",
3
+ "version": "8.5.1",
4
4
  "description": "Zero dependency layout manager supporting tabs, groups, grids and splitviews for vanilla TypeScript",
5
5
  "keywords": [
6
6
  "splitview",