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