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