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
  */
@@ -5027,7 +5027,7 @@
5027
5027
  this._element = document.createElement('div');
5028
5028
  this._element.className = 'dv-tab';
5029
5029
  this._element.tabIndex = 0;
5030
- this._element.draggable = true;
5030
+ this._element.draggable = !this.accessor.options.disableDnd;
5031
5031
  toggleClass(this.element, 'dv-inactive-tab', true);
5032
5032
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
5033
5033
  this.dropTarget = new Droptarget(this._element, {
@@ -5075,6 +5075,9 @@
5075
5075
  this.content = part;
5076
5076
  this._element.appendChild(this.content.element);
5077
5077
  }
5078
+ updateDragAndDropState() {
5079
+ this._element.draggable = !this.accessor.options.disableDnd;
5080
+ }
5078
5081
  dispose() {
5079
5082
  super.dispose();
5080
5083
  }
@@ -5146,7 +5149,7 @@
5146
5149
  this.onDragStart = this._onDragStart.event;
5147
5150
  this._element = document.createElement('div');
5148
5151
  this._element.className = 'dv-void-container';
5149
- this._element.draggable = true;
5152
+ this._element.draggable = !this.accessor.options.disableDnd;
5150
5153
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
5151
5154
  this.accessor.doSetGroupActive(this.group);
5152
5155
  }));
@@ -5169,6 +5172,9 @@
5169
5172
  this._onDrop.fire(event);
5170
5173
  }), this.dropTarget);
5171
5174
  }
5175
+ updateDragAndDropState() {
5176
+ this._element.draggable = !this.accessor.options.disableDnd;
5177
+ }
5172
5178
  }
5173
5179
 
5174
5180
  class Scrollbar extends CompositeDisposable {
@@ -5429,6 +5435,11 @@
5429
5435
  .map((x) => x.value.panel.id);
5430
5436
  this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
5431
5437
  }
5438
+ updateDragAndDropState() {
5439
+ for (const tab of this._tabs) {
5440
+ tab.value.updateDragAndDropState();
5441
+ }
5442
+ }
5432
5443
  }
5433
5444
 
5434
5445
  const createSvgElementFromPath = (params) => {
@@ -5701,6 +5712,10 @@
5701
5712
  });
5702
5713
  }));
5703
5714
  }
5715
+ updateDragAndDropState() {
5716
+ this.tabs.updateDragAndDropState();
5717
+ this.voidContainer.updateDragAndDropState();
5718
+ }
5704
5719
  }
5705
5720
 
5706
5721
  class DockviewUnhandledDragOverEvent extends AcceptableEvent {
@@ -6406,6 +6421,9 @@
6406
6421
  }));
6407
6422
  }
6408
6423
  }
6424
+ updateDragAndDropState() {
6425
+ this.tabsContainer.updateDragAndDropState();
6426
+ }
6409
6427
  dispose() {
6410
6428
  var _a, _b, _c;
6411
6429
  super.dispose();
@@ -8855,7 +8873,12 @@
8855
8873
  }
8856
8874
  }
8857
8875
  this.updateDropTargetModel(options);
8876
+ const oldDisableDnd = this.options.disableDnd;
8858
8877
  this._options = Object.assign(Object.assign({}, this.options), options);
8878
+ const newDisableDnd = this.options.disableDnd;
8879
+ if (oldDisableDnd !== newDisableDnd) {
8880
+ this.updateDragAndDropState();
8881
+ }
8859
8882
  if ('theme' in options) {
8860
8883
  this.updateTheme();
8861
8884
  }
@@ -8870,6 +8893,12 @@
8870
8893
  }
8871
8894
  }
8872
8895
  }
8896
+ updateDragAndDropState() {
8897
+ // Update draggable state for all tabs and void containers
8898
+ for (const group of this.groups) {
8899
+ group.model.updateDragAndDropState();
8900
+ }
8901
+ }
8873
8902
  focus() {
8874
8903
  var _a;
8875
8904
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();