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