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
  */
@@ -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,7 +2773,7 @@
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
2778
  super(document.createElement('div'), options.disableAutoResizing);
2779
2779
  this._id = nextLayoutId$1.next();
@@ -2794,7 +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
- parentElement.appendChild(this.element);
2797
+ // the container is owned by the third-party, do not modify/delete it
2798
+ container.appendChild(this.element);
2798
2799
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2799
2800
  this.gridview.locked = !!options.locked;
2800
2801
  this.element.appendChild(this.gridview.element);
@@ -7491,9 +7492,9 @@
7491
7492
  get floatingGroups() {
7492
7493
  return this._floatingGroups;
7493
7494
  }
7494
- constructor(parentElement, options) {
7495
+ constructor(container, options) {
7495
7496
  var _a;
7496
- super(parentElement, {
7497
+ super(container, {
7497
7498
  proportionalLayout: true,
7498
7499
  orientation: exports.Orientation.HORIZONTAL,
7499
7500
  styles: options.hideBorders
@@ -7849,6 +7850,16 @@
7849
7850
  group.model.renderContainer =
7850
7851
  this.overlayRenderContainer;
7851
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
+ }
7852
7863
  if (floatingBox) {
7853
7864
  this.addFloatingGroup(group, {
7854
7865
  height: floatingBox.height,
@@ -9025,9 +9036,9 @@
9025
9036
  set deserializer(value) {
9026
9037
  this._deserializer = value;
9027
9038
  }
9028
- constructor(parentElement, options) {
9039
+ constructor(container, options) {
9029
9040
  var _a;
9030
- super(parentElement, {
9041
+ super(container, {
9031
9042
  proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9032
9043
  orientation: options.orientation,
9033
9044
  styles: options.hideBorders
@@ -9316,9 +9327,9 @@
9316
9327
  ? this.splitview.size
9317
9328
  : this.splitview.orthogonalSize;
9318
9329
  }
9319
- constructor(parentElement, options) {
9330
+ constructor(container, options) {
9320
9331
  var _a;
9321
- super(parentElement, options.disableAutoResizing);
9332
+ super(document.createElement('div'), options.disableAutoResizing);
9322
9333
  this._splitviewChangeDisposable = new MutableDisposable();
9323
9334
  this._panels = new Map();
9324
9335
  this._onDidLayoutfromJSON = new Emitter();
@@ -9329,8 +9340,12 @@
9329
9340
  this.onDidRemoveView = this._onDidRemoveView.event;
9330
9341
  this._onDidLayoutChange = new Emitter();
9331
9342
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9343
+ this.element.style.height = '100%';
9344
+ this.element.style.width = '100%';
9332
9345
  this._classNames = new Classnames(this.element);
9333
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);
9334
9349
  this._options = options;
9335
9350
  this.splitview = new Splitview(this.element, options);
9336
9351
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
@@ -9640,9 +9655,9 @@
9640
9655
  get options() {
9641
9656
  return this._options;
9642
9657
  }
9643
- constructor(parentElement, options) {
9658
+ constructor(container, options) {
9644
9659
  var _a;
9645
- super(parentElement, options.disableAutoResizing);
9660
+ super(document.createElement('div'), options.disableAutoResizing);
9646
9661
  this._id = nextLayoutId.next();
9647
9662
  this._disposable = new MutableDisposable();
9648
9663
  this._viewDisposables = new Map();
@@ -9658,9 +9673,13 @@
9658
9673
  this.onDidRemoveView = this._onDidRemoveView.event;
9659
9674
  this._onUnhandledDragOverEvent = new Emitter();
9660
9675
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9676
+ this.element.style.height = '100%';
9677
+ this.element.style.width = '100%';
9661
9678
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9662
9679
  this._classNames = new Classnames(this.element);
9663
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);
9664
9683
  this._options = options;
9665
9684
  this.paneview = new Paneview(this.element, {
9666
9685
  // only allow paneview in the vertical orientation for now
@@ -10480,7 +10499,7 @@
10480
10499
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
10481
10500
  });
10482
10501
  }, [props.prefixHeaderActionsComponent]);
10483
- 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));
10484
10503
  });
10485
10504
  DockviewReact.displayName = 'DockviewComponent';
10486
10505
 
@@ -10617,7 +10636,7 @@
10617
10636
  },
10618
10637
  });
10619
10638
  }, [props.components]);
10620
- 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));
10621
10640
  });
10622
10641
  SplitviewReact.displayName = 'SplitviewComponent';
10623
10642
 
@@ -10700,7 +10719,7 @@
10700
10719
  },
10701
10720
  });
10702
10721
  }, [props.components]);
10703
- 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));
10704
10723
  });
10705
10724
  GridviewReact.displayName = 'GridviewComponent';
10706
10725
 
@@ -10832,7 +10851,7 @@
10832
10851
  disposable.dispose();
10833
10852
  };
10834
10853
  }, [props.onDidDrop]);
10835
- 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));
10836
10855
  });
10837
10856
  PaneviewReact.displayName = 'PaneviewComponent';
10838
10857