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
  */
@@ -2768,7 +2768,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2768
2768
  this.doSetGroupActive(next);
2769
2769
  }
2770
2770
  layout(width, height, forceResize) {
2771
- const different = forceResize !== null && forceResize !== void 0 ? forceResize : (width !== this.width || height !== this.height);
2771
+ const different = forceResize || width !== this.width || height !== this.height;
2772
2772
  if (!different) {
2773
2773
  return;
2774
2774
  }
@@ -3241,6 +3241,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3241
3241
  get totalPanels() {
3242
3242
  return this.component.totalPanels;
3243
3243
  }
3244
+ get gap() {
3245
+ return this.component.gap;
3246
+ }
3244
3247
  /**
3245
3248
  * Invoked when the active group changes. May be undefined if no group is active.
3246
3249
  */
@@ -7170,6 +7173,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7170
7173
  get api() {
7171
7174
  return this._api;
7172
7175
  }
7176
+ get gap() {
7177
+ return this.gridview.margin;
7178
+ }
7173
7179
  constructor(options) {
7174
7180
  var _a;
7175
7181
  super({
@@ -7339,7 +7345,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7339
7345
  var _a, _b, _c;
7340
7346
  if (itemToPopout instanceof DockviewPanel &&
7341
7347
  itemToPopout.group.size === 1) {
7342
- return this.addPopoutGroup(itemToPopout.group);
7348
+ return this.addPopoutGroup(itemToPopout.group, options);
7343
7349
  }
7344
7350
  const theme = getDockviewTheme(this.gridview.element);
7345
7351
  const element = this.element;
@@ -7557,14 +7563,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7557
7563
  else {
7558
7564
  result.top = DEFAULT_FLOATING_GROUP_POSITION.top;
7559
7565
  }
7560
- if ('width' in options.position) {
7561
- result.width = Math.max(options.position.width, 0);
7566
+ if (typeof options.width === 'number') {
7567
+ result.width = Math.max(options.width, 0);
7562
7568
  }
7563
7569
  else {
7564
7570
  result.width = DEFAULT_FLOATING_GROUP_POSITION.width;
7565
7571
  }
7566
- if ('height' in options.position) {
7567
- result.height = Math.max(options.position.height, 0);
7572
+ if (typeof options.height === 'number') {
7573
+ result.height = Math.max(options.height, 0);
7568
7574
  }
7569
7575
  else {
7570
7576
  result.height = DEFAULT_FLOATING_GROUP_POSITION.height;
@@ -7695,7 +7701,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7695
7701
  if (changed_rootOverlayOptions) {
7696
7702
  this._rootDropTarget.setOverlayModel(options.rootOverlayModel);
7697
7703
  }
7698
- if (this.gridview.margin !== 0 && options.gap === undefined) {
7704
+ if (
7705
+ // if explicitly set as `undefined`
7706
+ 'gap' in options &&
7707
+ options.gap === undefined) {
7699
7708
  this.gridview.margin = 0;
7700
7709
  }
7701
7710
  if (typeof options.gap === 'number') {
@@ -7996,11 +8005,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7996
8005
  if (options.floating) {
7997
8006
  const group = this.createGroup();
7998
8007
  this._onDidAddGroup.fire(group);
7999
- const o = typeof options.floating === 'object' &&
8008
+ const floatingGroupOptions = typeof options.floating === 'object' &&
8000
8009
  options.floating !== null
8001
8010
  ? options.floating
8002
8011
  : {};
8003
- this.addFloatingGroup(group, Object.assign(Object.assign({}, o), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8012
+ this.addFloatingGroup(group, Object.assign(Object.assign({}, floatingGroupOptions), { inDragMode: false, skipRemoveGroup: true, skipActiveGroup: true }));
8004
8013
  panel = this.createPanel(options, group);
8005
8014
  group.model.openPanel(panel, {
8006
8015
  skipSetActive: options.inactive,