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
  */
@@ -2772,7 +2772,7 @@
2772
2772
  this.doSetGroupActive(next);
2773
2773
  }
2774
2774
  layout(width, height, forceResize) {
2775
- const different = forceResize !== null && forceResize !== void 0 ? forceResize : (width !== this.width || height !== this.height);
2775
+ const different = forceResize || width !== this.width || height !== this.height;
2776
2776
  if (!different) {
2777
2777
  return;
2778
2778
  }
@@ -3245,6 +3245,9 @@
3245
3245
  get totalPanels() {
3246
3246
  return this.component.totalPanels;
3247
3247
  }
3248
+ get gap() {
3249
+ return this.component.gap;
3250
+ }
3248
3251
  /**
3249
3252
  * Invoked when the active group changes. May be undefined if no group is active.
3250
3253
  */
@@ -7174,6 +7177,9 @@
7174
7177
  get api() {
7175
7178
  return this._api;
7176
7179
  }
7180
+ get gap() {
7181
+ return this.gridview.margin;
7182
+ }
7177
7183
  constructor(options) {
7178
7184
  var _a;
7179
7185
  super({
@@ -7343,7 +7349,7 @@
7343
7349
  var _a, _b, _c;
7344
7350
  if (itemToPopout instanceof DockviewPanel &&
7345
7351
  itemToPopout.group.size === 1) {
7346
- return this.addPopoutGroup(itemToPopout.group);
7352
+ return this.addPopoutGroup(itemToPopout.group, options);
7347
7353
  }
7348
7354
  const theme = getDockviewTheme(this.gridview.element);
7349
7355
  const element = this.element;
@@ -7561,14 +7567,14 @@
7561
7567
  else {
7562
7568
  result.top = DEFAULT_FLOATING_GROUP_POSITION.top;
7563
7569
  }
7564
- if ('width' in options.position) {
7565
- result.width = Math.max(options.position.width, 0);
7570
+ if (typeof options.width === 'number') {
7571
+ result.width = Math.max(options.width, 0);
7566
7572
  }
7567
7573
  else {
7568
7574
  result.width = DEFAULT_FLOATING_GROUP_POSITION.width;
7569
7575
  }
7570
- if ('height' in options.position) {
7571
- result.height = Math.max(options.position.height, 0);
7576
+ if (typeof options.height === 'number') {
7577
+ result.height = Math.max(options.height, 0);
7572
7578
  }
7573
7579
  else {
7574
7580
  result.height = DEFAULT_FLOATING_GROUP_POSITION.height;
@@ -7699,7 +7705,10 @@
7699
7705
  if (changed_rootOverlayOptions) {
7700
7706
  this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7701
7707
  }
7702
- if (this.gridview.margin !== 0 && options.gap === undefined) {
7708
+ if (
7709
+ // if explicitly set as `undefined`
7710
+ 'gap' in options &&
7711
+ options.gap === undefined) {
7703
7712
  this.gridview.margin = 0;
7704
7713
  }
7705
7714
  if (typeof options.gap === 'number') {
@@ -8000,11 +8009,11 @@
8000
8009
  if (options.floating) {
8001
8010
  const group = this.createGroup();
8002
8011
  this._onDidAddGroup.fire(group);
8003
- const o = typeof options.floating === 'object' &&
8012
+ const floatingGroupOptions = typeof options.floating === 'object' &&
8004
8013
  options.floating !== null
8005
8014
  ? options.floating
8006
8015
  : {};
8007
- this.addFloatingGroup(group, Object.assign(Object.assign({}, o), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8016
+ this.addFloatingGroup(group, Object.assign(Object.assign({}, floatingGroupOptions), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8008
8017
  panel = this.createPanel(options, group);
8009
8018
  group.model.openPanel(panel, {
8010
8019
  skipSetActive: options.inactive,