dockview-react 1.15.0 → 1.15.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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-react
3
- * @version 1.15.0
3
+ * @version 1.15.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2801,7 +2801,7 @@ class BaseGrid extends Resizable {
2801
2801
  this.doSetGroupActive(next);
2802
2802
  }
2803
2803
  layout(width, height, forceResize) {
2804
- const different = forceResize !== null && forceResize !== void 0 ? forceResize : (width !== this.width || height !== this.height);
2804
+ const different = forceResize || width !== this.width || height !== this.height;
2805
2805
  if (!different) {
2806
2806
  return;
2807
2807
  }
@@ -3274,6 +3274,9 @@ class DockviewApi {
3274
3274
  get totalPanels() {
3275
3275
  return this.component.totalPanels;
3276
3276
  }
3277
+ get gap() {
3278
+ return this.component.gap;
3279
+ }
3277
3280
  /**
3278
3281
  * Invoked when the active group changes. May be undefined if no group is active.
3279
3282
  */
@@ -7203,6 +7206,9 @@ class DockviewComponent extends BaseGrid {
7203
7206
  get api() {
7204
7207
  return this._api;
7205
7208
  }
7209
+ get gap() {
7210
+ return this.gridview.margin;
7211
+ }
7206
7212
  constructor(options) {
7207
7213
  var _a;
7208
7214
  super({
@@ -7372,7 +7378,7 @@ class DockviewComponent extends BaseGrid {
7372
7378
  var _a, _b, _c;
7373
7379
  if (itemToPopout instanceof DockviewPanel &&
7374
7380
  itemToPopout.group.size === 1) {
7375
- return this.addPopoutGroup(itemToPopout.group);
7381
+ return this.addPopoutGroup(itemToPopout.group, options);
7376
7382
  }
7377
7383
  const theme = getDockviewTheme(this.gridview.element);
7378
7384
  const element = this.element;
@@ -7590,14 +7596,14 @@ class DockviewComponent extends BaseGrid {
7590
7596
  else {
7591
7597
  result.top = DEFAULT_FLOATING_GROUP_POSITION.top;
7592
7598
  }
7593
- if ('width' in options.position) {
7594
- result.width = Math.max(options.position.width, 0);
7599
+ if (typeof options.width === 'number') {
7600
+ result.width = Math.max(options.width, 0);
7595
7601
  }
7596
7602
  else {
7597
7603
  result.width = DEFAULT_FLOATING_GROUP_POSITION.width;
7598
7604
  }
7599
- if ('height' in options.position) {
7600
- result.height = Math.max(options.position.height, 0);
7605
+ if (typeof options.height === 'number') {
7606
+ result.height = Math.max(options.height, 0);
7601
7607
  }
7602
7608
  else {
7603
7609
  result.height = DEFAULT_FLOATING_GROUP_POSITION.height;
@@ -7728,7 +7734,10 @@ class DockviewComponent extends BaseGrid {
7728
7734
  if (changed_rootOverlayOptions) {
7729
7735
  this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7730
7736
  }
7731
- if (this.gridview.margin !== 0 && options.gap === undefined) {
7737
+ if (
7738
+ // if explicitly set as `undefined`
7739
+ 'gap' in options &&
7740
+ options.gap === undefined) {
7732
7741
  this.gridview.margin = 0;
7733
7742
  }
7734
7743
  if (typeof options.gap === 'number') {
@@ -8029,11 +8038,11 @@ class DockviewComponent extends BaseGrid {
8029
8038
  if (options.floating) {
8030
8039
  const group = this.createGroup();
8031
8040
  this._onDidAddGroup.fire(group);
8032
- const o = typeof options.floating === 'object' &&
8041
+ const floatingGroupOptions = typeof options.floating === 'object' &&
8033
8042
  options.floating !== null
8034
8043
  ? options.floating
8035
8044
  : {};
8036
- this.addFloatingGroup(group, Object.assign(Object.assign({}, o), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8045
+ this.addFloatingGroup(group, Object.assign(Object.assign({}, floatingGroupOptions), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8037
8046
  panel = this.createPanel(options, group);
8038
8047
  group.model.openPanel(panel, {
8039
8048
  skipSetActive: options.inactive,