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
  */
@@ -4997,7 +4997,7 @@
4997
4997
  this._element = document.createElement('div');
4998
4998
  this._element.className = 'dv-tab';
4999
4999
  this._element.tabIndex = 0;
5000
- this._element.draggable = true;
5000
+ this._element.draggable = !this.accessor.options.disableDnd;
5001
5001
  toggleClass(this.element, 'dv-inactive-tab', true);
5002
5002
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
5003
5003
  this.dropTarget = new Droptarget(this._element, {
@@ -5045,6 +5045,9 @@
5045
5045
  this.content = part;
5046
5046
  this._element.appendChild(this.content.element);
5047
5047
  }
5048
+ updateDragAndDropState() {
5049
+ this._element.draggable = !this.accessor.options.disableDnd;
5050
+ }
5048
5051
  dispose() {
5049
5052
  super.dispose();
5050
5053
  }
@@ -5116,7 +5119,7 @@
5116
5119
  this.onDragStart = this._onDragStart.event;
5117
5120
  this._element = document.createElement('div');
5118
5121
  this._element.className = 'dv-void-container';
5119
- this._element.draggable = true;
5122
+ this._element.draggable = !this.accessor.options.disableDnd;
5120
5123
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
5121
5124
  this.accessor.doSetGroupActive(this.group);
5122
5125
  }));
@@ -5139,6 +5142,9 @@
5139
5142
  this._onDrop.fire(event);
5140
5143
  }), this.dropTarget);
5141
5144
  }
5145
+ updateDragAndDropState() {
5146
+ this._element.draggable = !this.accessor.options.disableDnd;
5147
+ }
5142
5148
  }
5143
5149
 
5144
5150
  class Scrollbar extends CompositeDisposable {
@@ -5399,6 +5405,11 @@
5399
5405
  .map((x) => x.value.panel.id);
5400
5406
  this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
5401
5407
  }
5408
+ updateDragAndDropState() {
5409
+ for (const tab of this._tabs) {
5410
+ tab.value.updateDragAndDropState();
5411
+ }
5412
+ }
5402
5413
  }
5403
5414
 
5404
5415
  const createSvgElementFromPath = (params) => {
@@ -5671,6 +5682,10 @@
5671
5682
  });
5672
5683
  }));
5673
5684
  }
5685
+ updateDragAndDropState() {
5686
+ this.tabs.updateDragAndDropState();
5687
+ this.voidContainer.updateDragAndDropState();
5688
+ }
5674
5689
  }
5675
5690
 
5676
5691
  class DockviewUnhandledDragOverEvent extends AcceptableEvent {
@@ -6376,6 +6391,9 @@
6376
6391
  }));
6377
6392
  }
6378
6393
  }
6394
+ updateDragAndDropState() {
6395
+ this.tabsContainer.updateDragAndDropState();
6396
+ }
6379
6397
  dispose() {
6380
6398
  var _a, _b, _c;
6381
6399
  super.dispose();
@@ -8825,7 +8843,12 @@
8825
8843
  }
8826
8844
  }
8827
8845
  this.updateDropTargetModel(options);
8846
+ const oldDisableDnd = this.options.disableDnd;
8828
8847
  this._options = Object.assign(Object.assign({}, this.options), options);
8848
+ const newDisableDnd = this.options.disableDnd;
8849
+ if (oldDisableDnd !== newDisableDnd) {
8850
+ this.updateDragAndDropState();
8851
+ }
8829
8852
  if ('theme' in options) {
8830
8853
  this.updateTheme();
8831
8854
  }
@@ -8840,6 +8863,12 @@
8840
8863
  }
8841
8864
  }
8842
8865
  }
8866
+ updateDragAndDropState() {
8867
+ // Update draggable state for all tabs and void containers
8868
+ for (const group of this.groups) {
8869
+ group.model.updateDragAndDropState();
8870
+ }
8871
+ }
8843
8872
  focus() {
8844
8873
  var _a;
8845
8874
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();