dockview-react 4.4.0 → 4.4.1

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 4.4.0
3
+ * @version 4.4.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -4993,7 +4993,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4993
4993
  this._element = document.createElement('div');
4994
4994
  this._element.className = 'dv-tab';
4995
4995
  this._element.tabIndex = 0;
4996
- this._element.draggable = true;
4996
+ this._element.draggable = !this.accessor.options.disableDnd;
4997
4997
  toggleClass(this.element, 'dv-inactive-tab', true);
4998
4998
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
4999
4999
  this.dropTarget = new Droptarget(this._element, {
@@ -5041,6 +5041,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5041
5041
  this.content = part;
5042
5042
  this._element.appendChild(this.content.element);
5043
5043
  }
5044
+ updateDragAndDropState() {
5045
+ this._element.draggable = !this.accessor.options.disableDnd;
5046
+ }
5044
5047
  dispose() {
5045
5048
  super.dispose();
5046
5049
  }
@@ -5112,7 +5115,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5112
5115
  this.onDragStart = this._onDragStart.event;
5113
5116
  this._element = document.createElement('div');
5114
5117
  this._element.className = 'dv-void-container';
5115
- this._element.draggable = true;
5118
+ this._element.draggable = !this.accessor.options.disableDnd;
5116
5119
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
5117
5120
  this.accessor.doSetGroupActive(this.group);
5118
5121
  }));
@@ -5135,6 +5138,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5135
5138
  this._onDrop.fire(event);
5136
5139
  }), this.dropTarget);
5137
5140
  }
5141
+ updateDragAndDropState() {
5142
+ this._element.draggable = !this.accessor.options.disableDnd;
5143
+ }
5138
5144
  }
5139
5145
 
5140
5146
  class Scrollbar extends CompositeDisposable {
@@ -5395,6 +5401,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5395
5401
  .map((x) => x.value.panel.id);
5396
5402
  this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
5397
5403
  }
5404
+ updateDragAndDropState() {
5405
+ for (const tab of this._tabs) {
5406
+ tab.value.updateDragAndDropState();
5407
+ }
5408
+ }
5398
5409
  }
5399
5410
 
5400
5411
  const createSvgElementFromPath = (params) => {
@@ -5667,6 +5678,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5667
5678
  });
5668
5679
  }));
5669
5680
  }
5681
+ updateDragAndDropState() {
5682
+ this.tabs.updateDragAndDropState();
5683
+ this.voidContainer.updateDragAndDropState();
5684
+ }
5670
5685
  }
5671
5686
 
5672
5687
  class DockviewUnhandledDragOverEvent extends AcceptableEvent {
@@ -6372,6 +6387,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6372
6387
  }));
6373
6388
  }
6374
6389
  }
6390
+ updateDragAndDropState() {
6391
+ this.tabsContainer.updateDragAndDropState();
6392
+ }
6375
6393
  dispose() {
6376
6394
  var _a, _b, _c;
6377
6395
  super.dispose();
@@ -8821,7 +8839,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8821
8839
  }
8822
8840
  }
8823
8841
  this.updateDropTargetModel(options);
8842
+ const oldDisableDnd = this.options.disableDnd;
8824
8843
  this._options = Object.assign(Object.assign({}, this.options), options);
8844
+ const newDisableDnd = this.options.disableDnd;
8845
+ if (oldDisableDnd !== newDisableDnd) {
8846
+ this.updateDragAndDropState();
8847
+ }
8825
8848
  if ('theme' in options) {
8826
8849
  this.updateTheme();
8827
8850
  }
@@ -8836,6 +8859,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8836
8859
  }
8837
8860
  }
8838
8861
  }
8862
+ updateDragAndDropState() {
8863
+ // Update draggable state for all tabs and void containers
8864
+ for (const group of this.groups) {
8865
+ group.model.updateDragAndDropState();
8866
+ }
8867
+ }
8839
8868
  focus() {
8840
8869
  var _a;
8841
8870
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();