dockview-react 3.0.0 → 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.0
3
+ * @version 3.0.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -881,7 +881,7 @@ class Splitview {
881
881
  this._margin = value;
882
882
  }
883
883
  constructor(container, options) {
884
- var _a;
884
+ var _a, _b;
885
885
  this.container = container;
886
886
  this.viewItems = [];
887
887
  this.sashes = [];
@@ -979,9 +979,9 @@ class Splitview {
979
979
  //
980
980
  return delta;
981
981
  };
982
- this._orientation = options.orientation;
982
+ this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : Orientation.VERTICAL;
983
983
  this.element = this.createContainer();
984
- this.margin = (_a = options.margin) !== null && _a !== void 0 ? _a : 0;
984
+ this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
985
985
  this.proportionalLayout =
986
986
  options.proportionalLayout === undefined
987
987
  ? true
@@ -2800,7 +2800,7 @@ class BaseGrid extends Resizable {
2800
2800
  set locked(value) {
2801
2801
  this.gridview.locked = value;
2802
2802
  }
2803
- constructor(parentElement, options) {
2803
+ constructor(container, options) {
2804
2804
  var _a;
2805
2805
  super(document.createElement('div'), options.disableAutoResizing);
2806
2806
  this._id = nextLayoutId$1.next();
@@ -2821,7 +2821,8 @@ class BaseGrid extends Resizable {
2821
2821
  this.element.style.width = '100%';
2822
2822
  this._classNames = new Classnames(this.element);
2823
2823
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2824
- parentElement.appendChild(this.element);
2824
+ // the container is owned by the third-party, do not modify/delete it
2825
+ container.appendChild(this.element);
2825
2826
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2826
2827
  this.gridview.locked = !!options.locked;
2827
2828
  this.element.appendChild(this.gridview.element);
@@ -7518,9 +7519,9 @@ class DockviewComponent extends BaseGrid {
7518
7519
  get floatingGroups() {
7519
7520
  return this._floatingGroups;
7520
7521
  }
7521
- constructor(parentElement, options) {
7522
+ constructor(container, options) {
7522
7523
  var _a;
7523
- super(parentElement, {
7524
+ super(container, {
7524
7525
  proportionalLayout: true,
7525
7526
  orientation: Orientation.HORIZONTAL,
7526
7527
  styles: options.hideBorders
@@ -7876,6 +7877,16 @@ class DockviewComponent extends BaseGrid {
7876
7877
  group.model.renderContainer =
7877
7878
  this.overlayRenderContainer;
7878
7879
  returnedGroup = group;
7880
+ const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
7881
+ if (alreadyRemoved) {
7882
+ /**
7883
+ * If this popout group was explicitly removed then we shouldn't run the additional
7884
+ * steps. To tell if the running of this disposable is the result of this popout group
7885
+ * being explicitly removed we can check if this popout group is still referenced in
7886
+ * the `this._popoutGroups` list.
7887
+ */
7888
+ return;
7889
+ }
7879
7890
  if (floatingBox) {
7880
7891
  this.addFloatingGroup(group, {
7881
7892
  height: floatingBox.height,
@@ -9052,9 +9063,9 @@ class GridviewComponent extends BaseGrid {
9052
9063
  set deserializer(value) {
9053
9064
  this._deserializer = value;
9054
9065
  }
9055
- constructor(parentElement, options) {
9066
+ constructor(container, options) {
9056
9067
  var _a;
9057
- super(parentElement, {
9068
+ super(container, {
9058
9069
  proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9059
9070
  orientation: options.orientation,
9060
9071
  styles: options.hideBorders
@@ -9343,9 +9354,9 @@ class SplitviewComponent extends Resizable {
9343
9354
  ? this.splitview.size
9344
9355
  : this.splitview.orthogonalSize;
9345
9356
  }
9346
- constructor(parentElement, options) {
9357
+ constructor(container, options) {
9347
9358
  var _a;
9348
- super(parentElement, options.disableAutoResizing);
9359
+ super(document.createElement('div'), options.disableAutoResizing);
9349
9360
  this._splitviewChangeDisposable = new MutableDisposable();
9350
9361
  this._panels = new Map();
9351
9362
  this._onDidLayoutfromJSON = new Emitter();
@@ -9356,8 +9367,12 @@ class SplitviewComponent extends Resizable {
9356
9367
  this.onDidRemoveView = this._onDidRemoveView.event;
9357
9368
  this._onDidLayoutChange = new Emitter();
9358
9369
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9370
+ this.element.style.height = '100%';
9371
+ this.element.style.width = '100%';
9359
9372
  this._classNames = new Classnames(this.element);
9360
9373
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9374
+ // the container is owned by the third-party, do not modify/delete it
9375
+ container.appendChild(this.element);
9361
9376
  this._options = options;
9362
9377
  this.splitview = new Splitview(this.element, options);
9363
9378
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
@@ -9667,9 +9682,9 @@ class PaneviewComponent extends Resizable {
9667
9682
  get options() {
9668
9683
  return this._options;
9669
9684
  }
9670
- constructor(parentElement, options) {
9685
+ constructor(container, options) {
9671
9686
  var _a;
9672
- super(parentElement, options.disableAutoResizing);
9687
+ super(document.createElement('div'), options.disableAutoResizing);
9673
9688
  this._id = nextLayoutId.next();
9674
9689
  this._disposable = new MutableDisposable();
9675
9690
  this._viewDisposables = new Map();
@@ -9685,9 +9700,13 @@ class PaneviewComponent extends Resizable {
9685
9700
  this.onDidRemoveView = this._onDidRemoveView.event;
9686
9701
  this._onUnhandledDragOverEvent = new Emitter();
9687
9702
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9703
+ this.element.style.height = '100%';
9704
+ this.element.style.width = '100%';
9688
9705
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9689
9706
  this._classNames = new Classnames(this.element);
9690
9707
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9708
+ // the container is owned by the third-party, do not modify/delete it
9709
+ container.appendChild(this.element);
9691
9710
  this._options = options;
9692
9711
  this.paneview = new Paneview(this.element, {
9693
9712
  // only allow paneview in the vertical orientation for now
@@ -10507,7 +10526,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
10507
10526
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
10508
10527
  });
10509
10528
  }, [props.prefixHeaderActionsComponent]);
10510
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10529
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10511
10530
  });
10512
10531
  DockviewReact.displayName = 'DockviewComponent';
10513
10532
 
@@ -10644,7 +10663,7 @@ const SplitviewReact = React.forwardRef((props, ref) => {
10644
10663
  },
10645
10664
  });
10646
10665
  }, [props.components]);
10647
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10666
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10648
10667
  });
10649
10668
  SplitviewReact.displayName = 'SplitviewComponent';
10650
10669
 
@@ -10727,7 +10746,7 @@ const GridviewReact = React.forwardRef((props, ref) => {
10727
10746
  },
10728
10747
  });
10729
10748
  }, [props.components]);
10730
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10749
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10731
10750
  });
10732
10751
  GridviewReact.displayName = 'GridviewComponent';
10733
10752
 
@@ -10859,7 +10878,7 @@ const PaneviewReact = React.forwardRef((props, ref) => {
10859
10878
  disposable.dispose();
10860
10879
  };
10861
10880
  }, [props.onDidDrop]);
10862
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10881
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10863
10882
  });
10864
10883
  PaneviewReact.displayName = 'PaneviewComponent';
10865
10884