dockview 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.
@@ -225,6 +225,6 @@ exports.DockviewReact = react_1.default.forwardRef(function (props, ref) {
225
225
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal: addPortal }),
226
226
  });
227
227
  }, [props.prefixHeaderActionsComponent]);
228
- return (react_1.default.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
228
+ return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
229
229
  });
230
230
  exports.DockviewReact.displayName = 'DockviewComponent';
@@ -99,6 +99,6 @@ exports.GridviewReact = react_1.default.forwardRef(function (props, ref) {
99
99
  },
100
100
  });
101
101
  }, [props.components]);
102
- return (react_1.default.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
102
+ return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
103
103
  });
104
104
  exports.GridviewReact.displayName = 'GridviewComponent';
@@ -131,6 +131,6 @@ exports.PaneviewReact = react_1.default.forwardRef(function (props, ref) {
131
131
  disposable.dispose();
132
132
  };
133
133
  }, [props.onDidDrop]);
134
- return (react_1.default.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
134
+ return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
135
135
  });
136
136
  exports.PaneviewReact.displayName = 'PaneviewComponent';
@@ -99,6 +99,6 @@ exports.SplitviewReact = react_1.default.forwardRef(function (props, ref) {
99
99
  },
100
100
  });
101
101
  }, [props.components]);
102
- return (react_1.default.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
102
+ return (react_1.default.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
103
103
  });
104
104
  exports.SplitviewReact.displayName = 'SplitviewComponent';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 3.0.0
3
+ * @version 3.0.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -880,7 +880,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
880
880
  this._margin = value;
881
881
  }
882
882
  constructor(container, options) {
883
- var _a;
883
+ var _a, _b;
884
884
  this.container = container;
885
885
  this.viewItems = [];
886
886
  this.sashes = [];
@@ -978,9 +978,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
978
978
  //
979
979
  return delta;
980
980
  };
981
- this._orientation = options.orientation;
981
+ this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
982
982
  this.element = this.createContainer();
983
- this.margin = (_a = options.margin) !== null && _a !== void 0 ? _a : 0;
983
+ this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
984
984
  this.proportionalLayout =
985
985
  options.proportionalLayout === undefined
986
986
  ? true
@@ -2799,7 +2799,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2799
2799
  set locked(value) {
2800
2800
  this.gridview.locked = value;
2801
2801
  }
2802
- constructor(parentElement, options) {
2802
+ constructor(container, options) {
2803
2803
  var _a;
2804
2804
  super(document.createElement('div'), options.disableAutoResizing);
2805
2805
  this._id = nextLayoutId$1.next();
@@ -2820,7 +2820,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2820
2820
  this.element.style.width = '100%';
2821
2821
  this._classNames = new Classnames(this.element);
2822
2822
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
2823
- parentElement.appendChild(this.element);
2823
+ // the container is owned by the third-party, do not modify/delete it
2824
+ container.appendChild(this.element);
2824
2825
  this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
2825
2826
  this.gridview.locked = !!options.locked;
2826
2827
  this.element.appendChild(this.gridview.element);
@@ -7517,9 +7518,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7517
7518
  get floatingGroups() {
7518
7519
  return this._floatingGroups;
7519
7520
  }
7520
- constructor(parentElement, options) {
7521
+ constructor(container, options) {
7521
7522
  var _a;
7522
- super(parentElement, {
7523
+ super(container, {
7523
7524
  proportionalLayout: true,
7524
7525
  orientation: exports.Orientation.HORIZONTAL,
7525
7526
  styles: options.hideBorders
@@ -7875,6 +7876,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7875
7876
  group.model.renderContainer =
7876
7877
  this.overlayRenderContainer;
7877
7878
  returnedGroup = group;
7879
+ const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
7880
+ if (alreadyRemoved) {
7881
+ /**
7882
+ * If this popout group was explicitly removed then we shouldn't run the additional
7883
+ * steps. To tell if the running of this disposable is the result of this popout group
7884
+ * being explicitly removed we can check if this popout group is still referenced in
7885
+ * the `this._popoutGroups` list.
7886
+ */
7887
+ return;
7888
+ }
7878
7889
  if (floatingBox) {
7879
7890
  this.addFloatingGroup(group, {
7880
7891
  height: floatingBox.height,
@@ -9051,9 +9062,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9051
9062
  set deserializer(value) {
9052
9063
  this._deserializer = value;
9053
9064
  }
9054
- constructor(parentElement, options) {
9065
+ constructor(container, options) {
9055
9066
  var _a;
9056
- super(parentElement, {
9067
+ super(container, {
9057
9068
  proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
9058
9069
  orientation: options.orientation,
9059
9070
  styles: options.hideBorders
@@ -9342,9 +9353,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9342
9353
  ? this.splitview.size
9343
9354
  : this.splitview.orthogonalSize;
9344
9355
  }
9345
- constructor(parentElement, options) {
9356
+ constructor(container, options) {
9346
9357
  var _a;
9347
- super(parentElement, options.disableAutoResizing);
9358
+ super(document.createElement('div'), options.disableAutoResizing);
9348
9359
  this._splitviewChangeDisposable = new MutableDisposable();
9349
9360
  this._panels = new Map();
9350
9361
  this._onDidLayoutfromJSON = new Emitter();
@@ -9355,8 +9366,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9355
9366
  this.onDidRemoveView = this._onDidRemoveView.event;
9356
9367
  this._onDidLayoutChange = new Emitter();
9357
9368
  this.onDidLayoutChange = this._onDidLayoutChange.event;
9369
+ this.element.style.height = '100%';
9370
+ this.element.style.width = '100%';
9358
9371
  this._classNames = new Classnames(this.element);
9359
9372
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9373
+ // the container is owned by the third-party, do not modify/delete it
9374
+ container.appendChild(this.element);
9360
9375
  this._options = options;
9361
9376
  this.splitview = new Splitview(this.element, options);
9362
9377
  this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
@@ -9666,9 +9681,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9666
9681
  get options() {
9667
9682
  return this._options;
9668
9683
  }
9669
- constructor(parentElement, options) {
9684
+ constructor(container, options) {
9670
9685
  var _a;
9671
- super(parentElement, options.disableAutoResizing);
9686
+ super(document.createElement('div'), options.disableAutoResizing);
9672
9687
  this._id = nextLayoutId.next();
9673
9688
  this._disposable = new MutableDisposable();
9674
9689
  this._viewDisposables = new Map();
@@ -9684,9 +9699,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
9684
9699
  this.onDidRemoveView = this._onDidRemoveView.event;
9685
9700
  this._onUnhandledDragOverEvent = new Emitter();
9686
9701
  this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
9702
+ this.element.style.height = '100%';
9703
+ this.element.style.width = '100%';
9687
9704
  this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
9688
9705
  this._classNames = new Classnames(this.element);
9689
9706
  this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
9707
+ // the container is owned by the third-party, do not modify/delete it
9708
+ container.appendChild(this.element);
9690
9709
  this._options = options;
9691
9710
  this.paneview = new Paneview(this.element, {
9692
9711
  // only allow paneview in the vertical orientation for now
@@ -10506,7 +10525,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10506
10525
  createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
10507
10526
  });
10508
10527
  }, [props.prefixHeaderActionsComponent]);
10509
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10528
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10510
10529
  });
10511
10530
  DockviewReact.displayName = 'DockviewComponent';
10512
10531
 
@@ -10666,7 +10685,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10666
10685
  },
10667
10686
  });
10668
10687
  }, [props.components]);
10669
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10688
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10670
10689
  });
10671
10690
  SplitviewReact.displayName = 'SplitviewComponent';
10672
10691
 
@@ -10749,7 +10768,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10749
10768
  },
10750
10769
  });
10751
10770
  }, [props.components]);
10752
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10771
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10753
10772
  });
10754
10773
  GridviewReact.displayName = 'GridviewComponent';
10755
10774
 
@@ -10881,7 +10900,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
10881
10900
  disposable.dispose();
10882
10901
  };
10883
10902
  }, [props.onDidDrop]);
10884
- return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10903
+ return (React.createElement("div", { style: { height: '100%', width: '100%' }, ref: domRef }, portals));
10885
10904
  });
10886
10905
  PaneviewReact.displayName = 'PaneviewComponent';
10887
10906