@ai-ecoverse/slicc-spectrum 1.107.1 → 1.107.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/slicc-ui.js CHANGED
@@ -37401,6 +37401,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
37401
37401
  ];
37402
37402
  }
37403
37403
  #stuck = true;
37404
+ #card = null;
37404
37405
  #last = 0;
37405
37406
  #height = 0;
37406
37407
  #input = Number.NEGATIVE_INFINITY;
@@ -37456,12 +37457,12 @@ var SliccChat = class _SliccChat extends ThemedElement {
37456
37457
  this.#more();
37457
37458
  const log = this.#log();
37458
37459
  if (!this.#stuck && log.scrollHeight <= log.clientHeight) this.#follow();
37459
- else this.#pin();
37460
+ else this.#pin(false);
37460
37461
  });
37461
37462
  #fitted;
37462
37463
  #fit = new ResizeObserver(([entry]) => {
37463
37464
  this.style.setProperty("--composer-height", `${entry.target.offsetHeight}px`);
37464
- this.#pin();
37465
+ this.#pin(false);
37465
37466
  });
37466
37467
  #log() {
37467
37468
  return this.renderRoot.querySelector(".log");
@@ -37476,13 +37477,24 @@ var SliccChat = class _SliccChat extends ThemedElement {
37476
37477
  #bottom() {
37477
37478
  return this.#gap() <= this.#slack();
37478
37479
  }
37479
- #pin() {
37480
+ #pin(end = true) {
37480
37481
  if (!this.#stuck) return;
37481
37482
  const log = this.#log();
37482
- log.scrollTop = log.scrollHeight;
37483
+ const card2 = log.querySelector("swc-conversation-thread")?.lastElementChild ?? null;
37484
+ const held2 = !end && card2 !== null && card2 === this.#card;
37485
+ this.#card = card2;
37486
+ log.scrollTop = held2 ? this.#head(log, card2) : log.scrollHeight;
37483
37487
  this.#last = log.scrollTop;
37484
37488
  this.#height = log.scrollHeight;
37485
37489
  }
37490
+ #head(log, card2) {
37491
+ if (this.model?.agent.busy(this.#id())) return log.scrollHeight;
37492
+ const box = card2.getBoundingClientRect();
37493
+ const below = log.firstElementChild.getBoundingClientRect().bottom - box.bottom;
37494
+ const top = box.top - log.getBoundingClientRect().top - log.clientTop + log.scrollTop;
37495
+ if (below > 1 || top < log.scrollTop - 1) return log.scrollHeight;
37496
+ return top - (Number.parseFloat(getComputedStyle(log).paddingBlockStart) || 0);
37497
+ }
37486
37498
  #follow() {
37487
37499
  this.#stuck = true;
37488
37500
  this.behind = false;
@@ -37530,7 +37542,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
37530
37542
  this.behind = false;
37531
37543
  } else if (!this.#stuck) this.behind = true;
37532
37544
  this.requestUpdate();
37533
- void this.updateComplete.then(() => this.#pin());
37545
+ void this.updateComplete.then(() => this.#pin(jump));
37534
37546
  }
37535
37547
  #observe() {
37536
37548
  const log = this.#log();
@@ -51735,7 +51747,7 @@ var SliccDiffPanel = class extends ThemedElement {
51735
51747
  // src/app/lucide.ts
51736
51748
  var library = null;
51737
51749
  function load2() {
51738
- library ??= import("./chunk-57NDK5DC.js");
51750
+ library ??= import("./chunk-AI3R2QZY.js");
51739
51751
  return library;
51740
51752
  }
51741
51753
  function pascal(name) {
@@ -57349,8 +57361,9 @@ var ViewItem = class {
57349
57361
  if (visible2 === this.visible) return;
57350
57362
  if (visible2) {
57351
57363
  var _this$_cachedVisibleS;
57352
- this.size = clamp((_this$_cachedVisibleS = this._cachedVisibleSize) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : 0, this.viewMinimumSize, this.viewMaximumSize);
57364
+ const cachedVisibleSize = (_this$_cachedVisibleS = this._cachedVisibleSize) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : 0;
57353
57365
  this._cachedVisibleSize = void 0;
57366
+ this.size = clamp(cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize);
57354
57367
  } else {
57355
57368
  this._cachedVisibleSize = typeof size4 === "number" ? size4 : this.size;
57356
57369
  this.size = 0;
@@ -57465,6 +57478,15 @@ var Splitview = class {
57465
57478
  get margin() {
57466
57479
  return this._margin;
57467
57480
  }
57481
+ /**
57482
+ * The size each visible view gives up to the margins: `n` visible views
57483
+ * are separated by `n - 1` margins, spread evenly over the `n`.
57484
+ */
57485
+ get marginShare() {
57486
+ let visibleViewCount = 0;
57487
+ for (const item2 of this.viewItems) if (item2.visible) visibleViewCount++;
57488
+ return this.marginShareFor(visibleViewCount);
57489
+ }
57468
57490
  set margin(value) {
57469
57491
  this._margin = value;
57470
57492
  toggleClass(this.element, "dv-splitview-has-margin", value !== 0);
@@ -57757,6 +57779,7 @@ var Splitview = class {
57757
57779
  const previousSize = Math.max(this.size, this._contentSize);
57758
57780
  this.size = size4;
57759
57781
  this.orthogonalSize = orthogonalSize;
57782
+ if (!this._proportions) this.saveProportions();
57760
57783
  if (this.proportions) {
57761
57784
  let total = 0;
57762
57785
  for (let i25 = 0; i25 < this.viewItems.length; i25++) {
@@ -57813,7 +57836,10 @@ var Splitview = class {
57813
57836
  }
57814
57837
  }
57815
57838
  saveProportions() {
57816
- if (this.proportionalLayout && this._contentSize > 0) this._proportions = this.viewItems.map((i25) => i25.visible ? i25.size / this._contentSize : void 0);
57839
+ if (!this.proportionalLayout) return;
57840
+ let contentSize = 0;
57841
+ for (const item2 of this.viewItems) contentSize += item2.size;
57842
+ if (contentSize > 0) this._proportions = this.viewItems.map((i25) => i25.visible ? i25.size / contentSize : void 0);
57817
57843
  }
57818
57844
  /**
57819
57845
  * Margin explain:
@@ -57835,7 +57861,7 @@ var Splitview = class {
57835
57861
  this.updateSashEnablement();
57836
57862
  if (this.viewItems.length === 0) return;
57837
57863
  const sashCount = Math.max(0, visibleViewCount - 1);
57838
- const marginReducedSize = this.margin * sashCount / Math.max(1, visibleViewCount);
57864
+ const marginReducedSize = this.marginShareFor(visibleViewCount);
57839
57865
  let totalLeftOffset = 0;
57840
57866
  const viewLeftOffsets = [];
57841
57867
  const sashWidth = 4;
@@ -57865,9 +57891,13 @@ var Splitview = class {
57865
57891
  view.setContainerGeometry("width", "");
57866
57892
  view.setContainerGeometry("left", "");
57867
57893
  }
57868
- view.view.layout(view.size - marginReducedSize, this._orthogonalSize);
57894
+ view.view.layout(size4, this._orthogonalSize);
57869
57895
  });
57870
57896
  }
57897
+ marginShareFor(visibleViewCount) {
57898
+ const sashCount = Math.max(0, visibleViewCount - 1);
57899
+ return this._margin * sashCount / Math.max(1, visibleViewCount);
57900
+ }
57871
57901
  findFirstSnapIndex(indexes) {
57872
57902
  for (const index2 of indexes) {
57873
57903
  const viewItem = this.viewItems[index2];
@@ -59454,9 +59484,13 @@ var DockviewApi = class {
59454
59484
  }
59455
59485
  /**
59456
59486
  * Remove a panel given the panel object.
59487
+ *
59488
+ * `removeEmptyGroup` overrides the `closeEmptyGroups` option for this
59489
+ * call: `false` keeps the group if the panel was its last one, `true`
59490
+ * removes it.
59457
59491
  */
59458
- removePanel(panel) {
59459
- this.component.withOrigin("api", () => this.component.removePanel(panel));
59492
+ removePanel(panel, options2) {
59493
+ this.component.withOrigin("api", () => this.component.removePanel(panel, options2));
59460
59494
  }
59461
59495
  /**
59462
59496
  * Add a group and return the created object.
@@ -62048,6 +62082,7 @@ var PROPERTY_KEYS_DOCKVIEW = (() => {
62048
62082
  dndStrategy: void 0,
62049
62083
  className: void 0,
62050
62084
  noPanelsOverlay: void 0,
62085
+ closeEmptyGroups: void 0,
62051
62086
  dndEdges: void 0,
62052
62087
  dropPositionResolver: void 0,
62053
62088
  dndCompass: void 0,
@@ -66478,7 +66513,7 @@ var DockviewGroupPanelModel = class extends CompositeDisposable {
66478
66513
  });
66479
66514
  return;
66480
66515
  }
66481
- if (this.tabsContainer.indexOf(data.panelId) !== -1 && this.tabsContainer.size === 1) return;
66516
+ if (this.tabsContainer.indexOf(data.panelId) !== -1 && this.tabsContainer.size === 1 && this.accessor.options.closeEmptyGroups !== false) return;
66482
66517
  const { groupId, panelId } = data;
66483
66518
  if (this.id === groupId && !position2) {
66484
66519
  if (this.tabsContainer.indexOf(panelId) === index2) return;
@@ -66703,6 +66738,7 @@ var DockviewGroupPanelApiImpl = class extends GridviewPanelApiImpl {
66703
66738
  constructor(id, accessor) {
66704
66739
  super(id, "__dockviewgroup__");
66705
66740
  this.accessor = accessor;
66741
+ this._isApplyingSize = false;
66706
66742
  this._onDidLocationChange = new Emitter2();
66707
66743
  this.onDidLocationChange = this._onDidLocationChange.event;
66708
66744
  this._onDidActivePanelChange = new Emitter2();
@@ -66715,14 +66751,29 @@ var DockviewGroupPanelApiImpl = class extends GridviewPanelApiImpl {
66715
66751
  this.onDidHeaderDirectionChange = this._onDidHeaderDirectionChange.event;
66716
66752
  this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidCollapsedChange, this._onDidPeekChange, this._onDidHeaderDirectionChange, this._onDidVisibilityChange.event((event2) => {
66717
66753
  if (event2.isVisible && this._pendingSize) {
66718
- super.setSize(this._pendingSize);
66754
+ const pendingSize = this._pendingSize;
66719
66755
  this._pendingSize = void 0;
66756
+ super.setSize(pendingSize);
66720
66757
  }
66758
+ }), this.onDidDimensionsChange((event2) => {
66759
+ var _this$_reportedSize, _this$_reportedSize2;
66760
+ const moved2 = event2.width !== ((_this$_reportedSize = this._reportedSize) === null || _this$_reportedSize === void 0 ? void 0 : _this$_reportedSize.width) || event2.height !== ((_this$_reportedSize2 = this._reportedSize) === null || _this$_reportedSize2 === void 0 ? void 0 : _this$_reportedSize2.height);
66761
+ this._reportedSize = {
66762
+ width: event2.width,
66763
+ height: event2.height
66764
+ };
66765
+ if (moved2 && this.isVisible && !this._isApplyingSize) this._pendingSize = void 0;
66721
66766
  }));
66722
66767
  }
66723
66768
  setSize(event2) {
66724
- this._pendingSize = _objectSpread2({}, event2);
66725
- super.setSize(event2);
66769
+ if (typeof event2.width === "number" || typeof event2.height === "number") this._pendingSize = _objectSpread2({}, event2);
66770
+ const wasApplyingSize = this._isApplyingSize;
66771
+ this._isApplyingSize = true;
66772
+ try {
66773
+ super.setSize(event2);
66774
+ } finally {
66775
+ this._isApplyingSize = wasApplyingSize;
66776
+ }
66726
66777
  }
66727
66778
  close() {
66728
66779
  if (!this._group) return;
@@ -69589,6 +69640,19 @@ var DropTargetAnchorContainer = class extends CompositeDisposable {
69589
69640
  return el;
69590
69641
  }
69591
69642
  };
69643
+ var EDGE_POSITIONS = [
69644
+ "left",
69645
+ "right",
69646
+ "top",
69647
+ "bottom"
69648
+ ];
69649
+ function isHorizontal(position2) {
69650
+ return position2 === "left" || position2 === "right";
69651
+ }
69652
+ var UNBOUNDED_AXIS = {
69653
+ marginShare: 0,
69654
+ size: Number.POSITIVE_INFINITY
69655
+ };
69592
69656
  var EdgeGroupView = class {
69593
69657
  /**
69594
69658
  * The effective (pre-gap) collapsed size: the measured tab-strip size when
@@ -69600,7 +69664,7 @@ var EdgeGroupView = class {
69600
69664
  }
69601
69665
  get minimumSize() {
69602
69666
  if (this._isCollapsed) return this.collapsedSize;
69603
- return this._baseMinimumSize !== void 0 ? this._baseMinimumSize + this._gapAdd : this._effectiveBaseCollapsed + 50 + this._gapAdd;
69667
+ return this._baseMinimumSize !== void 0 ? this._baseMinimumSize + this._axis.marginShare : this._effectiveBaseCollapsed + 50 + this._axis.marginShare;
69604
69668
  }
69605
69669
  get maximumSize() {
69606
69670
  return this._isCollapsed ? this.collapsedSize : this._expandedMaximumSize;
@@ -69617,10 +69681,10 @@ var EdgeGroupView = class {
69617
69681
  }
69618
69682
  /** Without the gap share. */
69619
69683
  get lastExpandedContentSize() {
69620
- return this._lastExpandedSize - this._gapAdd;
69684
+ return this._lastExpandedSize - this._axis.marginShare;
69621
69685
  }
69622
69686
  get collapsedSize() {
69623
- return this._effectiveBaseCollapsed + this._gapAdd;
69687
+ return this._effectiveBaseCollapsed + this._axis.marginShare;
69624
69688
  }
69625
69689
  /** The user-configured (pre-gap) geometry constraints, for serialization.
69626
69690
  * These are the raw values passed to `addEdgeGroup`, unlike the effective
@@ -69635,13 +69699,14 @@ var EdgeGroupView = class {
69635
69699
  get configuredCollapsedSize() {
69636
69700
  return this._baseCollapsedSize;
69637
69701
  }
69638
- constructor(options2, group, orientation, gapAdd = 0) {
69702
+ constructor(options2, group, orientation, axis = UNBOUNDED_AXIS) {
69639
69703
  var _options$collapsedSiz, _options$maximumSize, _options$initialSize;
69640
69704
  this._onDidChange = new Emitter2();
69641
69705
  this.onDidChange = this._onDidChange.event;
69642
69706
  this.snap = false;
69643
69707
  this.priority = "low";
69644
69708
  this._isCollapsed = false;
69709
+ this._isVisible = true;
69645
69710
  this._tabSizeDisposables = new CompositeDisposable();
69646
69711
  this._group = group;
69647
69712
  this._orientation = orientation;
@@ -69649,7 +69714,7 @@ var EdgeGroupView = class {
69649
69714
  group.element.dataset.testid = `dv-edge-group-${options2.id}`;
69650
69715
  this._baseCollapsedSize = (_options$collapsedSiz = options2.collapsedSize) !== null && _options$collapsedSiz !== void 0 ? _options$collapsedSiz : 35;
69651
69716
  this._baseMinimumSize = options2.minimumSize;
69652
- this._gapAdd = gapAdd;
69717
+ this._axis = axis;
69653
69718
  this._expandedMaximumSize = (_options$maximumSize = options2.maximumSize) !== null && _options$maximumSize !== void 0 ? _options$maximumSize : Number.POSITIVE_INFINITY;
69654
69719
  this._lastExpandedSize = (_options$initialSize = options2.initialSize) !== null && _options$initialSize !== void 0 ? _options$initialSize : 200;
69655
69720
  if (options2.collapsed) {
@@ -69682,7 +69747,7 @@ var EdgeGroupView = class {
69682
69747
  if (this._isCollapsed) this._onDidChange.fire({ size: this.collapsedSize });
69683
69748
  }
69684
69749
  layout(size4, orthogonalSize) {
69685
- if (!this._isCollapsed) this._lastExpandedSize = size4 + this._gapAdd;
69750
+ if (!this._isCollapsed && this._isVisible && this._axis.size > 0) this._lastExpandedSize = size4 + this._axis.marginShare;
69686
69751
  if (this._orientation === "horizontal") this._group.layout(size4, orthogonalSize);
69687
69752
  else this._group.layout(orthogonalSize, size4);
69688
69753
  }
@@ -69691,26 +69756,25 @@ var EdgeGroupView = class {
69691
69756
  this._isCollapsed = collapsed;
69692
69757
  this._group.element.classList.toggle("dv-edge-collapsed", collapsed);
69693
69758
  }
69694
- setVisible(_visible) {
69759
+ setVisible(visible2) {
69760
+ this._isVisible = visible2;
69695
69761
  }
69696
69762
  /**
69697
- * Restore the last-expanded size from serialized state without triggering
69698
- * a layout. Must be called before setCollapsed(true) during fromJSON so
69699
- * that expanding after deserialization restores the correct size.
69763
+ * Set the expanded size without triggering a layout: from serialized
69764
+ * state (before setCollapsed(true) during fromJSON, so that expanding
69765
+ * restores the right size) or from an explicit resize.
69700
69766
  */
69701
69767
  restoreExpandedSize(size4) {
69702
69768
  this._lastExpandedSize = size4;
69703
69769
  }
69704
69770
  /**
69705
- * Apply a new base (pre-gap) collapsed size, base minimum size and gap
69706
- * contribution after a theme or gap change. Base values come from the
69707
- * original config; the ShellManager owns the gap arithmetic. A live
69708
- * measured tab size (if any) continues to win over the base collapsed size.
69771
+ * Apply a new base (pre-gap) collapsed size and base minimum size after a
69772
+ * theme change. Base values come from the original config. A live measured
69773
+ * tab size (if any) continues to win over the base collapsed size.
69709
69774
  */
69710
- updateSizing(baseCollapsedSize, baseMinimumSize, gapAdd) {
69775
+ updateSizing(baseCollapsedSize, baseMinimumSize) {
69711
69776
  this._baseCollapsedSize = baseCollapsedSize;
69712
69777
  this._baseMinimumSize = baseMinimumSize;
69713
- this._gapAdd = gapAdd;
69714
69778
  }
69715
69779
  dispose() {
69716
69780
  this._tabSizeDisposables.dispose();
@@ -69809,13 +69873,20 @@ var MiddleColumnView = class {
69809
69873
  const index2 = position2 === "top" ? this._topIndex : this._bottomIndex;
69810
69874
  if (index2 !== void 0) this._splitview.resizeView(index2, size4);
69811
69875
  }
69812
- /** The inner splitview's primary-axis (height) extent; zero until laid out. */
69813
- get axisSize() {
69814
- return this._splitview.size;
69876
+ /** The inner splitview, as the axis its edge views read. */
69877
+ get axis() {
69878
+ return this._splitview;
69815
69879
  }
69816
69880
  updateMargin(gap) {
69817
69881
  this._splitview.margin = gap;
69818
69882
  }
69883
+ /** Disables the sashes of the top/bottom edge groups. */
69884
+ get disabled() {
69885
+ return this._splitview.disabled;
69886
+ }
69887
+ set disabled(value) {
69888
+ this._splitview.disabled = value;
69889
+ }
69819
69890
  dispose() {
69820
69891
  this._onDidChange.dispose();
69821
69892
  this._splitview.dispose();
@@ -69851,8 +69922,6 @@ var ShellManager = class {
69851
69922
  const width = Math.round(entry.contentRect.width);
69852
69923
  const height = Math.round(entry.contentRect.height);
69853
69924
  if (width === this._currentWidth && height === this._currentHeight) return;
69854
- this._currentWidth = width;
69855
- this._currentHeight = height;
69856
69925
  this.layout(width, height);
69857
69926
  }), this._outerSplitview, this._middleColumn, centerView);
69858
69927
  }
@@ -69860,6 +69929,18 @@ var ShellManager = class {
69860
69929
  return this._shellElement;
69861
69930
  }
69862
69931
  /**
69932
+ * The dock's `locked` option. The edge groups are resized with the sashes
69933
+ * of the shell's own splitviews (left/right in the outer one, top/bottom
69934
+ * in the middle column), so locking disables both.
69935
+ */
69936
+ get locked() {
69937
+ return this._outerSplitview.disabled;
69938
+ }
69939
+ set locked(value) {
69940
+ this._outerSplitview.disabled = value;
69941
+ this._middleColumn.disabled = value;
69942
+ }
69943
+ /**
69863
69944
  * Add an edge group view at the given position. The view wraps the
69864
69945
  * provided group element inside the shell's splitview layout.
69865
69946
  * Throws if a group at this position is already registered.
@@ -69867,14 +69948,7 @@ var ShellManager = class {
69867
69948
  addEdgeView(position2, options2, group) {
69868
69949
  if (this.hasEdgeGroup(position2)) throw new Error(`dockview: edge group already registered at position '${position2}'`);
69869
69950
  this._viewConfigs.set(position2, options2);
69870
- const outerN = 1 + (this._viewConfigs.has("left") ? 1 : 0) + (this._viewConfigs.has("right") ? 1 : 0);
69871
- const innerN = 1 + (this._viewConfigs.has("top") ? 1 : 0) + (this._viewConfigs.has("bottom") ? 1 : 0);
69872
- const outerGapAdd = outerN > 1 ? this._gap * (outerN - 1) / outerN : 0;
69873
- const innerGapAdd = innerN > 1 ? this._gap * (innerN - 1) / innerN : 0;
69874
- const isHorizontal = position2 === "left" || position2 === "right";
69875
- const gapAdd = isHorizontal ? outerGapAdd : innerGapAdd;
69876
- const orientation = isHorizontal ? "horizontal" : "vertical";
69877
- const view = new EdgeGroupView(_objectSpread2({ collapsedSize: this._defaultCollapsedSize }, options2), group, orientation, gapAdd);
69951
+ const view = new EdgeGroupView(_objectSpread2({ collapsedSize: this._defaultCollapsedSize }, options2), group, isHorizontal(position2) ? "horizontal" : "vertical", this._axisFor(position2));
69878
69952
  const initialSize = view.isCollapsed ? view.collapsedSize : view.lastExpandedSize;
69879
69953
  switch (position2) {
69880
69954
  case "left":
@@ -69903,7 +69977,7 @@ var ShellManager = class {
69903
69977
  }
69904
69978
  this._disposables.addDisposables(view);
69905
69979
  if (!view.isCollapsed && !this._canResize(position2)) this._pendingSizes.set(position2, initialSize);
69906
- this.updateTheme(this._gap, this._defaultCollapsedSize);
69980
+ this._relayout();
69907
69981
  return view;
69908
69982
  }
69909
69983
  /**
@@ -69925,6 +69999,8 @@ var ShellManager = class {
69925
69999
  this.layout(width, height);
69926
70000
  }
69927
70001
  layout(width, height) {
70002
+ this._currentWidth = width;
70003
+ this._currentHeight = height;
69928
70004
  this._outerSplitview.layout(width, height);
69929
70005
  this._flushPendingSizes();
69930
70006
  }
@@ -69934,34 +70010,53 @@ var ShellManager = class {
69934
70010
  * and tab-strip dimensions.
69935
70011
  */
69936
70012
  updateTheme(gap, defaultCollapsedSize) {
69937
- var _this$_leftView, _this$_rightView, _this$_topView, _this$_bottomView;
69938
70013
  this._gap = gap;
69939
70014
  this._defaultCollapsedSize = defaultCollapsedSize;
69940
- const outerN = 1 + (this._viewConfigs.has("left") ? 1 : 0) + (this._viewConfigs.has("right") ? 1 : 0);
69941
- const innerN = 1 + (this._viewConfigs.has("top") ? 1 : 0) + (this._viewConfigs.has("bottom") ? 1 : 0);
69942
- const outerGapAdd = outerN > 1 ? gap * (outerN - 1) / outerN : 0;
69943
- const innerGapAdd = innerN > 1 ? gap * (innerN - 1) / innerN : 0;
69944
70015
  this._outerSplitview.margin = gap;
69945
70016
  this._middleColumn.updateMargin(gap);
69946
- const updateView = (view, baseCfg, gapAdd) => {
69947
- var _baseCfg$collapsedSiz;
69948
- const baseCS = (_baseCfg$collapsedSiz = baseCfg.collapsedSize) !== null && _baseCfg$collapsedSiz !== void 0 ? _baseCfg$collapsedSiz : defaultCollapsedSize;
69949
- view.updateSizing(baseCS, baseCfg.minimumSize, gapAdd);
69950
- };
69951
- const topCfg = this._viewConfigs.get("top");
69952
- if (this._topView && topCfg) updateView(this._topView, topCfg, innerGapAdd);
69953
- const bottomCfg = this._viewConfigs.get("bottom");
69954
- if (this._bottomView && bottomCfg) updateView(this._bottomView, bottomCfg, innerGapAdd);
69955
- const leftCfg = this._viewConfigs.get("left");
69956
- if (this._leftView && leftCfg) updateView(this._leftView, leftCfg, outerGapAdd);
69957
- const rightCfg = this._viewConfigs.get("right");
69958
- if (this._rightView && rightCfg) updateView(this._rightView, rightCfg, outerGapAdd);
69959
- if (((_this$_leftView = this._leftView) === null || _this$_leftView === void 0 ? void 0 : _this$_leftView.isCollapsed) && this._leftIndex !== void 0) this._outerSplitview.resizeView(this._leftIndex, this._leftView.collapsedSize);
69960
- if (((_this$_rightView = this._rightView) === null || _this$_rightView === void 0 ? void 0 : _this$_rightView.isCollapsed) && this._rightIndex !== void 0) this._outerSplitview.resizeView(this._rightIndex, this._rightView.collapsedSize);
69961
- if ((_this$_topView = this._topView) === null || _this$_topView === void 0 ? void 0 : _this$_topView.isCollapsed) this._middleColumn.resizeView("top", this._topView.collapsedSize);
69962
- if ((_this$_bottomView = this._bottomView) === null || _this$_bottomView === void 0 ? void 0 : _this$_bottomView.isCollapsed) this._middleColumn.resizeView("bottom", this._bottomView.collapsedSize);
70017
+ this._applyThemeSizing();
70018
+ this._relayout();
70019
+ }
70020
+ /** Whether the other edge of `position`'s axis holds a view. */
70021
+ _hasSiblingOn(position2) {
70022
+ return isHorizontal(position2) ? this._leftView !== void 0 && this._rightView !== void 0 : this._topView !== void 0 && this._bottomView !== void 0;
70023
+ }
70024
+ /** The splitview `position`'s view sits in, as its edge axis. */
70025
+ _axisFor(position2) {
70026
+ return isHorizontal(position2) ? this._outerSplitview : this._middleColumn.axis;
70027
+ }
70028
+ /** Re-derive every edge view's base sizing from its original config and
70029
+ * the current defaults. */
70030
+ _applyThemeSizing() {
70031
+ for (const position2 of EDGE_POSITIONS) {
70032
+ const view = this._getView(position2);
70033
+ const baseCfg = this._viewConfigs.get(position2);
70034
+ if (view && baseCfg) {
70035
+ var _baseCfg$collapsedSiz;
70036
+ view.updateSizing((_baseCfg$collapsedSiz = baseCfg.collapsedSize) !== null && _baseCfg$collapsedSiz !== void 0 ? _baseCfg$collapsedSiz : this._defaultCollapsedSize, baseCfg.minimumSize);
70037
+ }
70038
+ }
70039
+ }
70040
+ /**
70041
+ * Lay the shell out again at its current size, once it has one. The
70042
+ * splitviews clamp every view to its current constraints, which is how a
70043
+ * collapsed strip or a group at its minimum follows a moved gap share.
70044
+ */
70045
+ _relayout() {
69963
70046
  if (this._currentWidth > 0 && this._currentHeight > 0) this.layout(this._currentWidth, this._currentHeight);
69964
70047
  }
70048
+ /** The view's slot in its splitview: its laid-out size plus the gap share. */
70049
+ _slotSize(position2) {
70050
+ switch (position2) {
70051
+ case "left":
70052
+ return this._leftIndex === void 0 ? 0 : this._outerSplitview.getViewSize(this._leftIndex);
70053
+ case "right":
70054
+ return this._rightIndex === void 0 ? 0 : this._outerSplitview.getViewSize(this._rightIndex);
70055
+ case "top":
70056
+ case "bottom":
70057
+ return this._middleColumn.getViewSize(position2);
70058
+ }
70059
+ }
69965
70060
  removeEdgeView(position2) {
69966
70061
  const view = this._getView(position2);
69967
70062
  if (!view) return;
@@ -69991,7 +70086,7 @@ var ShellManager = class {
69991
70086
  view.dispose();
69992
70087
  this._viewConfigs.delete(position2);
69993
70088
  this._pendingSizes.delete(position2);
69994
- this.updateTheme(this._gap, this._defaultCollapsedSize);
70089
+ this._relayout();
69995
70090
  }
69996
70091
  hasEdgeGroup(position2) {
69997
70092
  switch (position2) {
@@ -70006,6 +70101,7 @@ var ShellManager = class {
70006
70101
  }
70007
70102
  }
70008
70103
  setEdgeGroupVisible(position2, visible2) {
70104
+ const changes2 = this._getView(position2) !== void 0 && visible2 !== this.isEdgeGroupVisible(position2);
70009
70105
  switch (position2) {
70010
70106
  case "left":
70011
70107
  if (this._leftIndex !== void 0) this._outerSplitview.setViewVisible(this._leftIndex, visible2);
@@ -70018,6 +70114,7 @@ var ShellManager = class {
70018
70114
  this._middleColumn.setViewVisible(position2, visible2);
70019
70115
  break;
70020
70116
  }
70117
+ if (changes2 && this._gap > 0 && this._hasSiblingOn(position2)) this._relayout();
70021
70118
  if (visible2) this._flushPendingSizes();
70022
70119
  }
70023
70120
  isEdgeGroupVisible(position2) {
@@ -70068,8 +70165,7 @@ var ShellManager = class {
70068
70165
  /** A resize lands only on a visible view (a hidden one is pinned to zero)
70069
70166
  * whose splitview has extent to distribute. */
70070
70167
  _canResize(position2) {
70071
- if (!this.isEdgeGroupVisible(position2)) return false;
70072
- return (position2 === "left" || position2 === "right" ? this._outerSplitview.size : this._middleColumn.axisSize) > 0;
70168
+ return this.isEdgeGroupVisible(position2) && this._axisFor(position2).size > 0;
70073
70169
  }
70074
70170
  _resizeView(position2, size4) {
70075
70171
  switch (position2) {
@@ -70118,59 +70214,48 @@ var ShellManager = class {
70118
70214
  }
70119
70215
  toJSON() {
70120
70216
  const edgeGroups = {};
70121
- const constraints = (view) => ({
70122
- minimumSize: view.configuredMinimumSize,
70123
- maximumSize: Number.isFinite(view.configuredMaximumSize) ? view.configuredMaximumSize : void 0,
70124
- collapsedSize: view.configuredCollapsedSize
70125
- });
70126
- const expandedSize = (view, position2, isVisible, liveSize, cachedVisibleSize) => {
70127
- if (view.isCollapsed) return view.lastExpandedSize;
70128
- const pending = this._pendingSizes.get(position2);
70129
- if (pending !== void 0) return pending;
70130
- if (!isVisible) return cachedVisibleSize !== null && cachedVisibleSize !== void 0 ? cachedVisibleSize : view.lastExpandedSize;
70131
- return liveSize;
70132
- };
70133
- if (this._leftView && this._leftIndex !== void 0) {
70134
- const visible2 = this._outerSplitview.isViewVisible(this._leftIndex);
70135
- edgeGroups.left = _objectSpread2({
70136
- size: expandedSize(this._leftView, "left", visible2, this._outerSplitview.getViewSize(this._leftIndex), this._outerSplitview.getViewCachedVisibleSize(this._leftIndex)),
70137
- visible: visible2,
70138
- collapsed: this._leftView.isCollapsed || void 0
70139
- }, constraints(this._leftView));
70140
- }
70141
- if (this._rightView && this._rightIndex !== void 0) {
70142
- const visible2 = this._outerSplitview.isViewVisible(this._rightIndex);
70143
- edgeGroups.right = _objectSpread2({
70144
- size: expandedSize(this._rightView, "right", visible2, this._outerSplitview.getViewSize(this._rightIndex), this._outerSplitview.getViewCachedVisibleSize(this._rightIndex)),
70217
+ for (const position2 of EDGE_POSITIONS) {
70218
+ const view = this._getView(position2);
70219
+ if (!view) continue;
70220
+ const visible2 = this.isEdgeGroupVisible(position2);
70221
+ edgeGroups[position2] = {
70222
+ size: this._expandedSize(view, position2, visible2),
70145
70223
  visible: visible2,
70146
- collapsed: this._rightView.isCollapsed || void 0
70147
- }, constraints(this._rightView));
70224
+ collapsed: view.isCollapsed || void 0,
70225
+ minimumSize: view.configuredMinimumSize,
70226
+ maximumSize: Number.isFinite(view.configuredMaximumSize) ? view.configuredMaximumSize : void 0,
70227
+ collapsedSize: view.configuredCollapsedSize
70228
+ };
70148
70229
  }
70149
- if (this._topView) {
70150
- const visible2 = this._middleColumn.isViewVisible("top");
70151
- edgeGroups.top = _objectSpread2({
70152
- size: expandedSize(this._topView, "top", visible2, this._middleColumn.getViewSize("top"), this._middleColumn.getViewCachedVisibleSize("top")),
70153
- visible: visible2,
70154
- collapsed: this._topView.isCollapsed || void 0
70155
- }, constraints(this._topView));
70230
+ return edgeGroups;
70231
+ }
70232
+ /** The size to restore the group to. An expanded-but-hidden group has a
70233
+ * slot of 0, so fall back to its cached visible size (then
70234
+ * lastExpandedSize); otherwise re-showing snaps to minimumSize. */
70235
+ _expandedSize(view, position2, visible2) {
70236
+ if (view.isCollapsed) return view.lastExpandedSize;
70237
+ const pending = this._pendingSizes.get(position2);
70238
+ if (pending !== void 0) return pending;
70239
+ if (!visible2) {
70240
+ var _this$_cachedVisibleS;
70241
+ return (_this$_cachedVisibleS = this._cachedVisibleSize(position2)) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : view.lastExpandedSize;
70156
70242
  }
70157
- if (this._bottomView) {
70158
- const visible2 = this._middleColumn.isViewVisible("bottom");
70159
- edgeGroups.bottom = _objectSpread2({
70160
- size: expandedSize(this._bottomView, "bottom", visible2, this._middleColumn.getViewSize("bottom"), this._middleColumn.getViewCachedVisibleSize("bottom")),
70161
- visible: visible2,
70162
- collapsed: this._bottomView.isCollapsed || void 0
70163
- }, constraints(this._bottomView));
70243
+ return this._slotSize(position2);
70244
+ }
70245
+ /** The slot a hidden view had when it was last visible. */
70246
+ _cachedVisibleSize(position2) {
70247
+ switch (position2) {
70248
+ case "left":
70249
+ return this._leftIndex === void 0 ? void 0 : this._outerSplitview.getViewCachedVisibleSize(this._leftIndex);
70250
+ case "right":
70251
+ return this._rightIndex === void 0 ? void 0 : this._outerSplitview.getViewCachedVisibleSize(this._rightIndex);
70252
+ case "top":
70253
+ case "bottom":
70254
+ return this._middleColumn.getViewCachedVisibleSize(position2);
70164
70255
  }
70165
- return edgeGroups;
70166
70256
  }
70167
70257
  fromJSON(data) {
70168
- for (const position2 of [
70169
- "left",
70170
- "right",
70171
- "top",
70172
- "bottom"
70173
- ]) {
70258
+ for (const position2 of EDGE_POSITIONS) {
70174
70259
  var _state$collapsed;
70175
70260
  const state2 = data[position2];
70176
70261
  const view = this._getView(position2);
@@ -70871,6 +70956,7 @@ var DockviewComponent = class extends BaseGrid {
70871
70956
  this.disableResizing = true;
70872
70957
  this.element.remove();
70873
70958
  this._shellManager = new ShellManager(container, this.element, (w7, h10) => this._layoutFromShell(w7, h10), (_options$theme$gap2 = (_options$theme2 = options2.theme) === null || _options$theme2 === void 0 ? void 0 : _options$theme2.gap) !== null && _options$theme$gap2 !== void 0 ? _options$theme$gap2 : 0, (_options$theme3 = options2.theme) === null || _options$theme3 === void 0 ? void 0 : _options$theme3.edgeGroupCollapsedSize);
70959
+ this._shellManager.locked = !!options2.locked;
70874
70960
  this.popupService.updateRoot(this._shellManager.element);
70875
70961
  this._shellThemeClassnames = new Classnames(this._shellManager.element);
70876
70962
  this.rootDropTargetContainer = new DropTargetAnchorContainer(this._shellManager.element, { disabled: true });
@@ -70975,7 +71061,7 @@ var DockviewComponent = class extends BaseGrid {
70975
71061
  const service = assertModule(this._popoutWindowService, "PopoutWindow", "api.addPopoutGroup");
70976
71062
  if (!service) return Promise.resolve(false);
70977
71063
  if (itemToPopout instanceof DockviewGroupPanel && itemToPopout.model.location.type === "edge") return Promise.resolve(false);
70978
- if (itemToPopout instanceof DockviewPanel && itemToPopout.group.size === 1) return this.addPopoutGroup(itemToPopout.group, options2);
71064
+ if (itemToPopout instanceof DockviewPanel && itemToPopout.group.size === 1 && this.closeEmptyGroups) return this.addPopoutGroup(itemToPopout.group, options2);
70979
71065
  const theme3 = getDockviewTheme(this.gridview.element);
70980
71066
  const element2 = this.element;
70981
71067
  function getBox() {
@@ -71060,7 +71146,8 @@ var DockviewComponent = class extends BaseGrid {
71060
71146
  const overlayRenderContainer = new OverlayRenderContainer(gready, this);
71061
71147
  group.model.renderContainer = overlayRenderContainer;
71062
71148
  const popoutGridview = (_options$overridePopo4 = options2 === null || options2 === void 0 ? void 0 : options2.overridePopoutGridview) !== null && _options$overridePopo4 !== void 0 ? _options$overridePopo4 : this.createNestedGridview();
71063
- if (!(options2 === null || options2 === void 0 ? void 0 : options2.overridePopoutGridview)) popoutGridview.addView(group, Sizing.Distribute, [0]);
71149
+ if (options2 === null || options2 === void 0 ? void 0 : options2.overridePopoutGridview) popoutGridview.locked = this.gridview.locked;
71150
+ else popoutGridview.addView(group, Sizing.Distribute, [0]);
71064
71151
  popoutGridview.element.style.width = "100%";
71065
71152
  popoutGridview.element.style.height = "100%";
71066
71153
  popoutGridview.layout(_window.window.innerWidth, _window.window.innerHeight);
@@ -71429,8 +71516,35 @@ var DockviewComponent = class extends BaseGrid {
71429
71516
  });
71430
71517
  for (const { panel, from } of movedPanels) this.fireDidMovePanel(panel, from);
71431
71518
  }
71519
+ /** The `closeEmptyGroups` option: remove a group once it empties. */
71520
+ get closeEmptyGroups() {
71521
+ return this.options.closeEmptyGroups !== false;
71522
+ }
71523
+ /** Whether a move leaves its emptied source group in place. */
71524
+ keepEmptyGroups(options2) {
71525
+ var _options$keepEmptyGro;
71526
+ return (_options$keepEmptyGro = options2.keepEmptyGroups) !== null && _options$keepEmptyGro !== void 0 ? _options$keepEmptyGro : !this.closeEmptyGroups;
71527
+ }
71432
71528
  removeGroupIfEmpty(group) {
71433
- if (group.model.size === 0) this.doRemoveGroup(group, { skipActive: true });
71529
+ if (group.model.size === 0 && this.closeEmptyGroups) this.doRemoveGroup(group, { skipActive: true });
71530
+ }
71531
+ /**
71532
+ * Locks the main grid, the shell whose splitviews host the edge groups,
71533
+ * and the nested gridviews of floating and popout windows. The base
71534
+ * setter stops at the main grid; `updateOptions` reaches this override.
71535
+ */
71536
+ get locked() {
71537
+ return this.gridview.locked;
71538
+ }
71539
+ set locked(value) {
71540
+ this.gridview.locked = value;
71541
+ if (this._shellManager) this._shellManager.locked = value;
71542
+ for (const gridview of this.nestedGridviews()) gridview.locked = value;
71543
+ }
71544
+ /** The gridviews hosted by open floating and popout windows. */
71545
+ nestedGridviews() {
71546
+ var _this$_popoutWindowSe9, _this$_popoutWindowSe10;
71547
+ return [...this.floatingGroups.map((floating) => floating.gridview), ...((_this$_popoutWindowSe9 = (_this$_popoutWindowSe10 = this._popoutWindowService) === null || _this$_popoutWindowSe10 === void 0 ? void 0 : _this$_popoutWindowSe10.entries) !== null && _this$_popoutWindowSe9 !== void 0 ? _this$_popoutWindowSe9 : []).map((entry) => entry.gridview)];
71434
71548
  }
71435
71549
  /**
71436
71550
  * Build an empty gridview configured to match the main grid's styling and
@@ -71439,7 +71553,7 @@ var DockviewComponent = class extends BaseGrid {
71439
71553
  */
71440
71554
  createNestedGridview(orientation = "HORIZONTAL") {
71441
71555
  var _this$options$theme$g, _this$options$theme2;
71442
- return new Gridview(this.gridview.proportionalLayout, this.options.hideBorders ? { separatorBorder: "transparent" } : void 0, orientation, false, (_this$options$theme$g = (_this$options$theme2 = this.options.theme) === null || _this$options$theme2 === void 0 ? void 0 : _this$options$theme2.gap) !== null && _this$options$theme$g !== void 0 ? _this$options$theme$g : 0);
71556
+ return new Gridview(this.gridview.proportionalLayout, this.options.hideBorders ? { separatorBorder: "transparent" } : void 0, orientation, this.gridview.locked, (_this$options$theme$g = (_this$options$theme2 = this.options.theme) === null || _this$options$theme2 === void 0 ? void 0 : _this$options$theme2.gap) !== null && _this$options$theme$g !== void 0 ? _this$options$theme$g : 0);
71443
71557
  }
71444
71558
  /**
71445
71559
  * Wrap a (populated) floating gridview in an overlay window: title bar /
@@ -71517,10 +71631,8 @@ var DockviewComponent = class extends BaseGrid {
71517
71631
  const newDndStrategy = this.options.dndStrategy;
71518
71632
  if (oldDisableDnd !== newDisableDnd || oldDndStrategy !== newDndStrategy) this.updateDragAndDropState();
71519
71633
  if ("proportionalLayout" in options2) {
71520
- var _this$_popoutWindowSe9, _this$_popoutWindowSe10;
71521
71634
  const proportionalLayout = this.gridview.proportionalLayout;
71522
- for (const floating of this.floatingGroups) floating.gridview.proportionalLayout = proportionalLayout;
71523
- for (const entry of (_this$_popoutWindowSe9 = (_this$_popoutWindowSe10 = this._popoutWindowService) === null || _this$_popoutWindowSe10 === void 0 ? void 0 : _this$_popoutWindowSe10.entries) !== null && _this$_popoutWindowSe9 !== void 0 ? _this$_popoutWindowSe9 : []) entry.gridview.proportionalLayout = proportionalLayout;
71635
+ for (const gridview of this.nestedGridviews()) gridview.proportionalLayout = proportionalLayout;
71524
71636
  }
71525
71637
  if ("theme" in options2) this.updateTheme();
71526
71638
  if ("createRightHeaderActionComponent" in options2 || "createLeftHeaderActionComponent" in options2 || "createPrefixHeaderActionComponent" in options2) {
@@ -71589,7 +71701,7 @@ var DockviewComponent = class extends BaseGrid {
71589
71701
  const resizeDisposable = group.onDidChange((event2) => {
71590
71702
  var _this$_shellManager3;
71591
71703
  if (!event2) return;
71592
- const size4 = position2 === "left" || position2 === "right" ? event2.width : event2.height;
71704
+ const size4 = isHorizontal(position2) ? event2.width : event2.height;
71593
71705
  if (typeof size4 !== "number") return;
71594
71706
  (_this$_shellManager3 = this._shellManager) === null || _this$_shellManager3 === void 0 || _this$_shellManager3.resizeEdgeGroup(position2, size4);
71595
71707
  });
@@ -72184,9 +72296,12 @@ var DockviewComponent = class extends BaseGrid {
72184
72296
  }
72185
72297
  closeAllGroups() {
72186
72298
  this.mutation("remove", () => {
72187
- for (const entry of this._groups.entries()) {
72188
- const [_7, group] = entry;
72189
- group.value.model.closeAllPanels();
72299
+ const groups2 = Array.from(this._groups.values()).map((_7) => _7.value);
72300
+ for (const group of groups2) {
72301
+ if (!this._groups.has(group.id)) continue;
72302
+ group.model.closeAllPanels();
72303
+ const keepLast = this.options.noPanelsOverlay === "emptyGroup" && this._groups.size === 1;
72304
+ if (!this.closeEmptyGroups && !keepLast && this._groups.has(group.id) && group.model.size === 0) this.removeGroup(group, { skipActive: true });
72190
72305
  }
72191
72306
  });
72192
72307
  }
@@ -72311,7 +72426,7 @@ var DockviewComponent = class extends BaseGrid {
72311
72426
  this.mutation("remove", () => {
72312
72427
  var _options$removeEmptyG;
72313
72428
  return this._doRemovePanel(panel, {
72314
- removeEmptyGroup: (_options$removeEmptyG = options2 === null || options2 === void 0 ? void 0 : options2.removeEmptyGroup) !== null && _options$removeEmptyG !== void 0 ? _options$removeEmptyG : true,
72429
+ removeEmptyGroup: (_options$removeEmptyG = options2 === null || options2 === void 0 ? void 0 : options2.removeEmptyGroup) !== null && _options$removeEmptyG !== void 0 ? _options$removeEmptyG : this.closeEmptyGroups,
72315
72430
  skipDispose: options2 === null || options2 === void 0 ? void 0 : options2.skipDispose,
72316
72431
  skipSetActiveGroup: options2 === null || options2 === void 0 ? void 0 : options2.skipSetActiveGroup
72317
72432
  });
@@ -72467,7 +72582,7 @@ var DockviewComponent = class extends BaseGrid {
72467
72582
  if (!(options2 === null || options2 === void 0 ? void 0 : options2.skipDispose)) {
72468
72583
  if (!(options2 === null || options2 === void 0 ? void 0 : options2.skipPopoutAssociated)) {
72469
72584
  const refGroup = selectedGroup.referenceGroup ? this.getPanel(selectedGroup.referenceGroup) : void 0;
72470
- if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0) this.removeGroup(refGroup);
72585
+ if ((refGroup === null || refGroup === void 0 ? void 0 : refGroup.panels.length) === 0 && (this.closeEmptyGroups || !refGroup.api.isVisible)) this.removeGroup(refGroup);
72471
72586
  }
72472
72587
  selectedGroup.popoutGroup.dispose();
72473
72588
  this._groups.delete(group.id);
@@ -72718,7 +72833,7 @@ var DockviewComponent = class extends BaseGrid {
72718
72833
  skipSetActiveGroup: true
72719
72834
  }));
72720
72835
  if (!removedPanel) throw new Error(`dockview: No panel with id ${sourceItemId}`);
72721
- if (!options2.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
72836
+ if (!this.keepEmptyGroups(options2) && sourceGroup.model.size === 0 && sourceGroup !== destinationGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
72722
72837
  const isDestinationGroupEmpty = destinationGroup.model.size === 0;
72723
72838
  this.movingLock(() => {
72724
72839
  var _options$skipSetActiv;
@@ -72734,7 +72849,7 @@ var DockviewComponent = class extends BaseGrid {
72734
72849
  const destinationGridview = this.getGridviewForGroup(destinationGroup);
72735
72850
  const referenceLocation = getGridLocation(destinationGroup.element);
72736
72851
  const targetLocation = getRelativeLocation(destinationGridview.orientation, referenceLocation, destinationTarget);
72737
- if (sourceGroup.size < 2) {
72852
+ if (sourceGroup.size < 2 && !this.keepEmptyGroups(options2)) {
72738
72853
  const [targetParentLocation, to] = tail(targetLocation);
72739
72854
  if (sourceGroup.api.location.type === "grid" && destinationGridview === this.gridview) {
72740
72855
  const [sourceParentLocation, from] = tail(getGridLocation(sourceGroup.element));
@@ -72835,7 +72950,7 @@ var DockviewComponent = class extends BaseGrid {
72835
72950
  const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, destinationTarget);
72836
72951
  targetGroup = this.createGroupAtLocation(dropLocation, this.dropSizing(referenceLocation));
72837
72952
  }
72838
- if (!options2.keepEmptyGroups && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
72953
+ if (!this.keepEmptyGroups(options2) && sourceGroup.model.size === 0 && sourceGroup !== targetGroup) this.doRemoveGroup(sourceGroup, { skipActive: true });
72839
72954
  addPanelsToGroup(targetGroup);
72840
72955
  }
72841
72956
  moveGroup(options2) {
@@ -73154,13 +73269,12 @@ var DockviewComponent = class extends BaseGrid {
73154
73269
  return location2.length % 2 == 1 ? rootOrientation : orthogonal(rootOrientation);
73155
73270
  }
73156
73271
  updateTheme() {
73157
- var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$_popoutWindowSe25, _this$_popoutWindowSe26, _this$_shellManager5, _theme$edgeGroupColla, _theme$tabGroupIndica;
73272
+ var _this$_options$theme, _this$_shellThemeClas, _theme$gap, _this$_shellManager5, _theme$edgeGroupColla, _theme$tabGroupIndica;
73158
73273
  const theme3 = (_this$_options$theme = this._options.theme) !== null && _this$_options$theme !== void 0 ? _this$_options$theme : themeAbyss;
73159
73274
  (_this$_shellThemeClas = this._shellThemeClassnames) === null || _this$_shellThemeClas === void 0 || _this$_shellThemeClas.setClassNames(theme3.className);
73160
73275
  const gap = (_theme$gap = theme3.gap) !== null && _theme$gap !== void 0 ? _theme$gap : 0;
73161
73276
  this.gridview.margin = gap;
73162
- for (const floating of this.floatingGroups) floating.gridview.margin = gap;
73163
- for (const entry of (_this$_popoutWindowSe25 = (_this$_popoutWindowSe26 = this._popoutWindowService) === null || _this$_popoutWindowSe26 === void 0 ? void 0 : _this$_popoutWindowSe26.entries) !== null && _this$_popoutWindowSe25 !== void 0 ? _this$_popoutWindowSe25 : []) entry.gridview.margin = gap;
73277
+ for (const gridview of this.nestedGridviews()) gridview.margin = gap;
73164
73278
  (_this$_shellManager5 = this._shellManager) === null || _this$_shellManager5 === void 0 || _this$_shellManager5.updateTheme(gap, (_theme$edgeGroupColla = theme3.edgeGroupCollapsedSize) !== null && _theme$edgeGroupColla !== void 0 ? _theme$edgeGroupColla : 35);
73165
73279
  if (theme3.dndOverlayBorder === void 0) {
73166
73280
  var _this$_shellManager6;
@@ -83146,7 +83260,7 @@ lit-html/static.js:
83146
83260
  dockview-core/dist/package/main.esm.mjs:
83147
83261
  (**
83148
83262
  * dockview-core
83149
- * @version 8.5.1
83263
+ * @version 8.6.0
83150
83264
  * @link https://github.com/dockview/dockview
83151
83265
  * @license MIT
83152
83266
  *)