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
  */
@@ -854,7 +854,7 @@
854
854
  this._margin = value;
855
855
  }
856
856
  constructor(container, options) {
857
- var _a;
857
+ var _a, _b;
858
858
  this.container = container;
859
859
  this.viewItems = [];
860
860
  this.sashes = [];
@@ -952,9 +952,9 @@
952
952
  //
953
953
  return delta;
954
954
  };
955
- this._orientation = options.orientation;
955
+ this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
956
956
  this.element = this.createContainer();
957
- this.margin = (_a = options.margin) !== null && _a !== void 0 ? _a : 0;
957
+ this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
958
958
  this.proportionalLayout =
959
959
  options.proportionalLayout === undefined
960
960
  ? true
@@ -2773,9 +2773,9 @@
2773
2773
  set locked(value) {
2774
2774
  this.gridview.locked = value;
2775
2775
  }
2776
- constructor(parentElement, options) {
2776
+ constructor(container, options) {
2777
2777
  var _a;
2778
- super(parentElement, options.disableAutoResizing);
2778
+ super(document.createElement('div'), options.disableAutoResizing);
2779
2779
  this._id = nextLayoutId$1.next();
2780
2780
  this._groups = new Map();
2781
2781
  this._onDidRemove = new Emitter();
@@ -2794,6 +2794,8 @@
2794
2794
  this.element.style.width = '100%';
2795
2795
  this._classNames = new Classnames(this.element);
2796
2796
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2797
+ // the container is owned by the third-party, do not modify/delete it
2798
+ container.appendChild(this.element);
2797
2799
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2798
2800
  this.gridview.locked = !!options.locked;
2799
2801
  this.element.appendChild(this.gridview.element);
@@ -7490,9 +7492,9 @@
7490
7492
  get floatingGroups() {
7491
7493
  return this._floatingGroups;
7492
7494
  }
7493
- constructor(parentElement, options) {
7495
+ constructor(container, options) {
7494
7496
  var _a;
7495
- super(parentElement, {
7497
+ super(container, {
7496
7498
  proportionalLayout: true,
7497
7499
  orientation: exports.Orientation.HORIZONTAL,
7498
7500
  styles: options.hideBorders
@@ -7848,6 +7850,16 @@
7848
7850
  group.model.renderContainer =
7849
7851
  this.overlayRenderContainer;
7850
7852
  returnedGroup = group;
7853
+ const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
7854
+ if (alreadyRemoved) {
7855
+ /**
7856
+ * If this popout group was explicitly removed then we shouldn't run the additional
7857
+ * steps. To tell if the running of this disposable is the result of this popout group
7858
+ * being explicitly removed we can check if this popout group is still referenced in
7859
+ * the `this._popoutGroups` list.
7860
+ */
7861
+ return;
7862
+ }
7851
7863
  if (floatingBox) {
7852
7864
  this.addFloatingGroup(group, {
7853
7865
  height: floatingBox.height,
@@ -9024,9 +9036,9 @@
9024
9036
  set deserializer(value) {
9025
9037
  this._deserializer = value;
9026
9038
  }
9027
- constructor(parentElement, options) {
9039
+ constructor(container, options) {
9028
9040
  var _a;
9029
- super(parentElement, {
9041
+ super(container, {
9030
9042
  proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9031
9043
  orientation: options.orientation,
9032
9044
  styles: options.hideBorders
@@ -9315,9 +9327,9 @@
9315
9327
  ? this.splitview.size
9316
9328
  : this.splitview.orthogonalSize;
9317
9329
  }
9318
- constructor(parentElement, options) {
9330
+ constructor(container, options) {
9319
9331
  var _a;
9320
- super(parentElement, options.disableAutoResizing);
9332
+ super(document.createElement('div'), options.disableAutoResizing);
9321
9333
  this._splitviewChangeDisposable = new MutableDisposable();
9322
9334
  this._panels = new Map();
9323
9335
  this._onDidLayoutfromJSON = new Emitter();
@@ -9328,8 +9340,12 @@
9328
9340
  this.onDidRemoveView = this._onDidRemoveView.event;
9329
9341
  this._onDidLayoutChange = new Emitter();
9330
9342
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9343
+ this.element.style.height = '100%';
9344
+ this.element.style.width = '100%';
9331
9345
  this._classNames = new Classnames(this.element);
9332
9346
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9347
+ // the container is owned by the third-party, do not modify/delete it
9348
+ container.appendChild(this.element);
9333
9349
  this._options = options;
9334
9350
  this.splitview = new Splitview(this.element, options);
9335
9351
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
@@ -9639,9 +9655,9 @@
9639
9655
  get options() {
9640
9656
  return this._options;
9641
9657
  }
9642
- constructor(parentElement, options) {
9658
+ constructor(container, options) {
9643
9659
  var _a;
9644
- super(parentElement, options.disableAutoResizing);
9660
+ super(document.createElement('div'), options.disableAutoResizing);
9645
9661
  this._id = nextLayoutId.next();
9646
9662
  this._disposable = new MutableDisposable();
9647
9663
  this._viewDisposables = new Map();
@@ -9657,9 +9673,13 @@
9657
9673
  this.onDidRemoveView = this._onDidRemoveView.event;
9658
9674
  this._onUnhandledDragOverEvent = new Emitter();
9659
9675
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9676
+ this.element.style.height = '100%';
9677
+ this.element.style.width = '100%';
9660
9678
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9661
9679
  this._classNames = new Classnames(this.element);
9662
9680
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9681
+ // the container is owned by the third-party, do not modify/delete it
9682
+ container.appendChild(this.element);
9663
9683
  this._options = options;
9664
9684
  this.paneview = new Paneview(this.element, {
9665
9685
  // only allow paneview in the vertical orientation for now
@@ -10479,7 +10499,7 @@
10479
10499
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
10480
10500
  });
10481
10501
  }, [props.prefixHeaderActionsComponent]);
10482
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10502
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10483
10503
  });
10484
10504
  DockviewReact.displayName = 'DockviewComponent';
10485
10505
 
@@ -10616,7 +10636,7 @@
10616
10636
  },
10617
10637
  });
10618
10638
  }, [props.components]);
10619
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10639
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10620
10640
  });
10621
10641
  SplitviewReact.displayName = 'SplitviewComponent';
10622
10642
 
@@ -10699,7 +10719,7 @@
10699
10719
  },
10700
10720
  });
10701
10721
  }, [props.components]);
10702
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10722
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10703
10723
  });
10704
10724
  GridviewReact.displayName = 'GridviewComponent';
10705
10725
 
@@ -10831,7 +10851,7 @@
10831
10851
  disposable.dispose();
10832
10852
  };
10833
10853
  }, [props.onDidDrop]);
10834
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10854
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10835
10855
  });
10836
10856
  PaneviewReact.displayName = 'PaneviewComponent';
10837
10857