dockview-react 3.0.1 → 3.0.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 3.0.1
3
+ * @version 3.0.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -850,7 +850,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
850
850
  this._margin = value;
851
851
  }
852
852
  constructor(container, options) {
853
- var _a;
853
+ var _a, _b;
854
854
  this.container = container;
855
855
  this.viewItems = [];
856
856
  this.sashes = [];
@@ -948,9 +948,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
948
948
  //
949
949
  return delta;
950
950
  };
951
- this._orientation = options.orientation;
951
+ this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
952
952
  this.element = this.createContainer();
953
- this.margin = (_a = options.margin) !== null && _a !== void 0 ? _a : 0;
953
+ this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
954
954
  this.proportionalLayout =
955
955
  options.proportionalLayout === undefined
956
956
  ? true
@@ -2769,9 +2769,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2769
2769
  set locked(value) {
2770
2770
  this.gridview.locked = value;
2771
2771
  }
2772
- constructor(parentElement, options) {
2772
+ constructor(container, options) {
2773
2773
  var _a;
2774
- super(parentElement, options.disableAutoResizing);
2774
+ super(document.createElement('div'), options.disableAutoResizing);
2775
2775
  this._id = nextLayoutId$1.next();
2776
2776
  this._groups = new Map();
2777
2777
  this._onDidRemove = new Emitter();
@@ -2790,6 +2790,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2790
2790
  this.element.style.width = '100%';
2791
2791
  this._classNames = new Classnames(this.element);
2792
2792
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2793
+ // the container is owned by the third-party, do not modify/delete it
2794
+ container.appendChild(this.element);
2793
2795
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2794
2796
  this.gridview.locked = !!options.locked;
2795
2797
  this.element.appendChild(this.gridview.element);
@@ -7486,9 +7488,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7486
7488
  get floatingGroups() {
7487
7489
  return this._floatingGroups;
7488
7490
  }
7489
- constructor(parentElement, options) {
7491
+ constructor(container, options) {
7490
7492
  var _a;
7491
- super(parentElement, {
7493
+ super(container, {
7492
7494
  proportionalLayout: true,
7493
7495
  orientation: exports.Orientation.HORIZONTAL,
7494
7496
  styles: options.hideBorders
@@ -7844,6 +7846,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7844
7846
  group.model.renderContainer =
7845
7847
  this.overlayRenderContainer;
7846
7848
  returnedGroup = group;
7849
+ const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
7850
+ if (alreadyRemoved) {
7851
+ /**
7852
+ * If this popout group was explicitly removed then we shouldn't run the additional
7853
+ * steps. To tell if the running of this disposable is the result of this popout group
7854
+ * being explicitly removed we can check if this popout group is still referenced in
7855
+ * the `this._popoutGroups` list.
7856
+ */
7857
+ return;
7858
+ }
7847
7859
  if (floatingBox) {
7848
7860
  this.addFloatingGroup(group, {
7849
7861
  height: floatingBox.height,
@@ -9020,9 +9032,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9020
9032
  set deserializer(value) {
9021
9033
  this._deserializer = value;
9022
9034
  }
9023
- constructor(parentElement, options) {
9035
+ constructor(container, options) {
9024
9036
  var _a;
9025
- super(parentElement, {
9037
+ super(container, {
9026
9038
  proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9027
9039
  orientation: options.orientation,
9028
9040
  styles: options.hideBorders
@@ -9311,9 +9323,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9311
9323
  ? this.splitview.size
9312
9324
  : this.splitview.orthogonalSize;
9313
9325
  }
9314
- constructor(parentElement, options) {
9326
+ constructor(container, options) {
9315
9327
  var _a;
9316
- super(parentElement, options.disableAutoResizing);
9328
+ super(document.createElement('div'), options.disableAutoResizing);
9317
9329
  this._splitviewChangeDisposable = new MutableDisposable();
9318
9330
  this._panels = new Map();
9319
9331
  this._onDidLayoutfromJSON = new Emitter();
@@ -9324,8 +9336,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9324
9336
  this.onDidRemoveView = this._onDidRemoveView.event;
9325
9337
  this._onDidLayoutChange = new Emitter();
9326
9338
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9339
+ this.element.style.height = '100%';
9340
+ this.element.style.width = '100%';
9327
9341
  this._classNames = new Classnames(this.element);
9328
9342
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9343
+ // the container is owned by the third-party, do not modify/delete it
9344
+ container.appendChild(this.element);
9329
9345
  this._options = options;
9330
9346
  this.splitview = new Splitview(this.element, options);
9331
9347
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
@@ -9635,9 +9651,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9635
9651
  get options() {
9636
9652
  return this._options;
9637
9653
  }
9638
- constructor(parentElement, options) {
9654
+ constructor(container, options) {
9639
9655
  var _a;
9640
- super(parentElement, options.disableAutoResizing);
9656
+ super(document.createElement('div'), options.disableAutoResizing);
9641
9657
  this._id = nextLayoutId.next();
9642
9658
  this._disposable = new MutableDisposable();
9643
9659
  this._viewDisposables = new Map();
@@ -9653,9 +9669,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9653
9669
  this.onDidRemoveView = this._onDidRemoveView.event;
9654
9670
  this._onUnhandledDragOverEvent = new Emitter();
9655
9671
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9672
+ this.element.style.height = '100%';
9673
+ this.element.style.width = '100%';
9656
9674
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9657
9675
  this._classNames = new Classnames(this.element);
9658
9676
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9677
+ // the container is owned by the third-party, do not modify/delete it
9678
+ container.appendChild(this.element);
9659
9679
  this._options = options;
9660
9680
  this.paneview = new Paneview(this.element, {
9661
9681
  // only allow paneview in the vertical orientation for now
@@ -10475,7 +10495,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10475
10495
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
10476
10496
  });
10477
10497
  }, [props.prefixHeaderActionsComponent]);
10478
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10498
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10479
10499
  });
10480
10500
  DockviewReact.displayName = 'DockviewComponent';
10481
10501
 
@@ -10612,7 +10632,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10612
10632
  },
10613
10633
  });
10614
10634
  }, [props.components]);
10615
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10635
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10616
10636
  });
10617
10637
  SplitviewReact.displayName = 'SplitviewComponent';
10618
10638
 
@@ -10695,7 +10715,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10695
10715
  },
10696
10716
  });
10697
10717
  }, [props.components]);
10698
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10718
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10699
10719
  });
10700
10720
  GridviewReact.displayName = 'GridviewComponent';
10701
10721
 
@@ -10827,7 +10847,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10827
10847
  disposable.dispose();
10828
10848
  };
10829
10849
  }, [props.onDidDrop]);
10830
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10850
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10831
10851
  });
10832
10852
  PaneviewReact.displayName = 'PaneviewComponent';
10833
10853