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