dockview-react 4.10.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-react
3
- * @version 4.10.0
3
+ * @version 4.11.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -6792,11 +6792,16 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
6792
6792
  }
6793
6793
  }
6794
6794
 
6795
+ // GridConstraintChangeEvent2 is not exported, so we'll type it manually
6795
6796
  const MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH = 100;
6796
6797
  const MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT = 100;
6797
6798
  class DockviewGroupPanel extends GridviewPanel {
6798
6799
  get minimumWidth() {
6799
6800
  var _a;
6801
+ // Check for explicitly set group constraint first
6802
+ if (typeof this._explicitConstraints.minimumWidth === 'number') {
6803
+ return this._explicitConstraints.minimumWidth;
6804
+ }
6800
6805
  const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
6801
6806
  if (typeof activePanelMinimumWidth === 'number') {
6802
6807
  return activePanelMinimumWidth;
@@ -6805,6 +6810,10 @@ class DockviewGroupPanel extends GridviewPanel {
6805
6810
  }
6806
6811
  get minimumHeight() {
6807
6812
  var _a;
6813
+ // Check for explicitly set group constraint first
6814
+ if (typeof this._explicitConstraints.minimumHeight === 'number') {
6815
+ return this._explicitConstraints.minimumHeight;
6816
+ }
6808
6817
  const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
6809
6818
  if (typeof activePanelMinimumHeight === 'number') {
6810
6819
  return activePanelMinimumHeight;
@@ -6813,6 +6822,10 @@ class DockviewGroupPanel extends GridviewPanel {
6813
6822
  }
6814
6823
  get maximumWidth() {
6815
6824
  var _a;
6825
+ // Check for explicitly set group constraint first
6826
+ if (typeof this._explicitConstraints.maximumWidth === 'number') {
6827
+ return this._explicitConstraints.maximumWidth;
6828
+ }
6816
6829
  const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
6817
6830
  if (typeof activePanelMaximumWidth === 'number') {
6818
6831
  return activePanelMaximumWidth;
@@ -6821,6 +6834,10 @@ class DockviewGroupPanel extends GridviewPanel {
6821
6834
  }
6822
6835
  get maximumHeight() {
6823
6836
  var _a;
6837
+ // Check for explicitly set group constraint first
6838
+ if (typeof this._explicitConstraints.maximumHeight === 'number') {
6839
+ return this._explicitConstraints.maximumHeight;
6840
+ }
6824
6841
  const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
6825
6842
  if (typeof activePanelMaximumHeight === 'number') {
6826
6843
  return activePanelMaximumHeight;
@@ -6852,14 +6869,39 @@ class DockviewGroupPanel extends GridviewPanel {
6852
6869
  var _a, _b, _c, _d, _e, _f;
6853
6870
  super(id, 'groupview_default', {
6854
6871
  minimumHeight: (_b = (_a = options.constraints) === null || _a === void 0 ? void 0 : _a.minimumHeight) !== null && _b !== void 0 ? _b : MINIMUM_DOCKVIEW_GROUP_PANEL_HEIGHT,
6855
- minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.maximumHeight) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6872
+ minimumWidth: (_d = (_c = options.constraints) === null || _c === void 0 ? void 0 : _c.minimumWidth) !== null && _d !== void 0 ? _d : MINIMUM_DOCKVIEW_GROUP_PANEL_WIDTH,
6856
6873
  maximumHeight: (_e = options.constraints) === null || _e === void 0 ? void 0 : _e.maximumHeight,
6857
6874
  maximumWidth: (_f = options.constraints) === null || _f === void 0 ? void 0 : _f.maximumWidth,
6858
6875
  }, new DockviewGroupPanelApiImpl(id, accessor));
6876
+ // Track explicitly set constraints to override panel constraints
6877
+ this._explicitConstraints = {};
6859
6878
  this.api.initialize(this); // cannot use 'this' after after 'super' call
6860
6879
  this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
6861
6880
  this.addDisposables(this.model.onDidActivePanelChange((event) => {
6862
6881
  this.api._onDidActivePanelChange.fire(event);
6882
+ }), this.api.onDidConstraintsChangeInternal((event) => {
6883
+ // Track explicitly set constraints to override panel constraints
6884
+ // Extract numeric values from functions or values
6885
+ if (event.minimumWidth !== undefined) {
6886
+ this._explicitConstraints.minimumWidth = typeof event.minimumWidth === 'function'
6887
+ ? event.minimumWidth()
6888
+ : event.minimumWidth;
6889
+ }
6890
+ if (event.minimumHeight !== undefined) {
6891
+ this._explicitConstraints.minimumHeight = typeof event.minimumHeight === 'function'
6892
+ ? event.minimumHeight()
6893
+ : event.minimumHeight;
6894
+ }
6895
+ if (event.maximumWidth !== undefined) {
6896
+ this._explicitConstraints.maximumWidth = typeof event.maximumWidth === 'function'
6897
+ ? event.maximumWidth()
6898
+ : event.maximumWidth;
6899
+ }
6900
+ if (event.maximumHeight !== undefined) {
6901
+ this._explicitConstraints.maximumHeight = typeof event.maximumHeight === 'function'
6902
+ ? event.maximumHeight()
6903
+ : event.maximumHeight;
6904
+ }
6863
6905
  }));
6864
6906
  }
6865
6907
  focus() {