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