dockview-core 4.9.0 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 4.9.0
3
+ * @version 4.11.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -6789,11 +6789,16 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
6789
6789
  }
6790
6790
  }
6791
6791
 
6792
+ // GridConstraintChangeEvent2 is not exported, so we'll type it manually
6792
6793
  const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
6793
6794
  const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
6794
6795
  class DockviewGroupPanel extends GridviewPanel {
6795
6796
  get minimumWidth() {
6796
6797
  var _a;
6798
+ // Check for explicitly set group constraint first
6799
+ if (typeof this._explicitConstraints.minimumWidth === 'number') {
6800
+ return this._explicitConstraints.minimumWidth;
6801
+ }
6797
6802
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6798
6803
  if (typeof activePanelMinimumWidth === 'number') {
6799
6804
  return activePanelMinimumWidth;
@@ -6802,6 +6807,10 @@ class DockviewGroupPanel extends GridviewPanel {
6802
6807
  }
6803
6808
  get minimumHeight() {
6804
6809
  var _a;
6810
+ // Check for explicitly set group constraint first
6811
+ if (typeof this._explicitConstraints.minimumHeight === 'number') {
6812
+ return this._explicitConstraints.minimumHeight;
6813
+ }
6805
6814
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6806
6815
  if (typeof activePanelMinimumHeight === 'number') {
6807
6816
  return activePanelMinimumHeight;
@@ -6810,6 +6819,10 @@ class DockviewGroupPanel extends GridviewPanel {
6810
6819
  }
6811
6820
  get maximumWidth() {
6812
6821
  var _a;
6822
+ // Check for explicitly set group constraint first
6823
+ if (typeof this._explicitConstraints.maximumWidth === 'number') {
6824
+ return this._explicitConstraints.maximumWidth;
6825
+ }
6813
6826
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6814
6827
  if (typeof activePanelMaximumWidth === 'number') {
6815
6828
  return activePanelMaximumWidth;
@@ -6818,6 +6831,10 @@ class DockviewGroupPanel extends GridviewPanel {
6818
6831
  }
6819
6832
  get maximumHeight() {
6820
6833
  var _a;
6834
+ // Check for explicitly set group constraint first
6835
+ if (typeof this._explicitConstraints.maximumHeight === 'number') {
6836
+ return this._explicitConstraints.maximumHeight;
6837
+ }
6821
6838
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6822
6839
  if (typeof activePanelMaximumHeight === 'number') {
6823
6840
  return activePanelMaximumHeight;
@@ -6849,14 +6866,39 @@ class DockviewGroupPanel extends GridviewPanel {
6849
6866
  var _a, _b, _c, _d, _e, _f;
6850
6867
  super(id, 'groupview_default', {
6851
6868
  minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
6852
- minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6869
+ minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.minimumWidth) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6853
6870
  maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
6854
6871
  maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
6855
6872
  }, new DockviewGroupPanelApiImpl(id, accessor));
6873
+ // Track explicitly set constraints to override panel constraints
6874
+ this._explicitConstraints = {};
6856
6875
  this.api.initialize(this); // cannot use 'this' after after 'super' call
6857
6876
  this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
6858
6877
  this.addDisposables(this.model.onDidActivePanelChange((event) => {
6859
6878
  this.api._onDidActivePanelChange.fire(event);
6879
+ }), this.api.onDidConstraintsChangeInternal((event) => {
6880
+ // Track explicitly set constraints to override panel constraints
6881
+ // Extract numeric values from functions or values
6882
+ if (event.minimumWidth !== undefined) {
6883
+ this._explicitConstraints.minimumWidth = typeof event.minimumWidth === 'function'
6884
+ ? event.minimumWidth()
6885
+ : event.minimumWidth;
6886
+ }
6887
+ if (event.minimumHeight !== undefined) {
6888
+ this._explicitConstraints.minimumHeight = typeof event.minimumHeight === 'function'
6889
+ ? event.minimumHeight()
6890
+ : event.minimumHeight;
6891
+ }
6892
+ if (event.maximumWidth !== undefined) {
6893
+ this._explicitConstraints.maximumWidth = typeof event.maximumWidth === 'function'
6894
+ ? event.maximumWidth()
6895
+ : event.maximumWidth;
6896
+ }
6897
+ if (event.maximumHeight !== undefined) {
6898
+ this._explicitConstraints.maximumHeight = typeof event.maximumHeight === 'function'
6899
+ ? event.maximumHeight()
6900
+ : event.maximumHeight;
6901
+ }
6860
6902
  }));
6861
6903
  }
6862
6904
  focus() {
@@ -10324,8 +10366,8 @@ class GridviewComponent extends BaseGrid {
10324
10366
  accessor: this,
10325
10367
  isVisible: true,
10326
10368
  });
10327
- this.registerPanel(view);
10328
10369
  this.doAddGroup(view, relativeLocation, options.size);
10370
+ this.registerPanel(view);
10329
10371
  this.doSetGroupActive(view);
10330
10372
  return view;
10331
10373
  }