dockview 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
  import React from 'react';
2
2
  import { IDockviewPanelHeaderProps } from 'dockview-core';
3
- export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps & React.DOMAttributes<HTMLDivElement> & {
3
+ export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps & React.HtmlHTMLAttributes<HTMLDivElement> & {
4
4
  hideClose?: boolean;
5
5
  closeActionOverride?: () => void;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 4.4.0
3
+ * @version 4.4.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -5023,7 +5023,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5023
5023
  this._element = document.createElement('div');
5024
5024
  this._element.className = 'dv-tab';
5025
5025
  this._element.tabIndex = 0;
5026
- this._element.draggable = true;
5026
+ this._element.draggable = !this.accessor.options.disableDnd;
5027
5027
  toggleClass(this.element, 'dv-inactive-tab', true);
5028
5028
  const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
5029
5029
  this.dropTarget = new Droptarget(this._element, {
@@ -5071,6 +5071,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5071
5071
  this.content = part;
5072
5072
  this._element.appendChild(this.content.element);
5073
5073
  }
5074
+ updateDragAndDropState() {
5075
+ this._element.draggable = !this.accessor.options.disableDnd;
5076
+ }
5074
5077
  dispose() {
5075
5078
  super.dispose();
5076
5079
  }
@@ -5142,7 +5145,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5142
5145
  this.onDragStart = this._onDragStart.event;
5143
5146
  this._element = document.createElement('div');
5144
5147
  this._element.className = 'dv-void-container';
5145
- this._element.draggable = true;
5148
+ this._element.draggable = !this.accessor.options.disableDnd;
5146
5149
  this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
5147
5150
  this.accessor.doSetGroupActive(this.group);
5148
5151
  }));
@@ -5165,6 +5168,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5165
5168
  this._onDrop.fire(event);
5166
5169
  }), this.dropTarget);
5167
5170
  }
5171
+ updateDragAndDropState() {
5172
+ this._element.draggable = !this.accessor.options.disableDnd;
5173
+ }
5168
5174
  }
5169
5175
 
5170
5176
  class Scrollbar extends CompositeDisposable {
@@ -5425,6 +5431,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5425
5431
  .map((x) => x.value.panel.id);
5426
5432
  this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
5427
5433
  }
5434
+ updateDragAndDropState() {
5435
+ for (const tab of this._tabs) {
5436
+ tab.value.updateDragAndDropState();
5437
+ }
5438
+ }
5428
5439
  }
5429
5440
 
5430
5441
  const createSvgElementFromPath = (params) => {
@@ -5697,6 +5708,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5697
5708
  });
5698
5709
  }));
5699
5710
  }
5711
+ updateDragAndDropState() {
5712
+ this.tabs.updateDragAndDropState();
5713
+ this.voidContainer.updateDragAndDropState();
5714
+ }
5700
5715
  }
5701
5716
 
5702
5717
  class DockviewUnhandledDragOverEvent extends AcceptableEvent {
@@ -6402,6 +6417,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6402
6417
  }));
6403
6418
  }
6404
6419
  }
6420
+ updateDragAndDropState() {
6421
+ this.tabsContainer.updateDragAndDropState();
6422
+ }
6405
6423
  dispose() {
6406
6424
  var _a, _b, _c;
6407
6425
  super.dispose();
@@ -8851,7 +8869,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8851
8869
  }
8852
8870
  }
8853
8871
  this.updateDropTargetModel(options);
8872
+ const oldDisableDnd = this.options.disableDnd;
8854
8873
  this._options = Object.assign(Object.assign({}, this.options), options);
8874
+ const newDisableDnd = this.options.disableDnd;
8875
+ if (oldDisableDnd !== newDisableDnd) {
8876
+ this.updateDragAndDropState();
8877
+ }
8855
8878
  if ('theme' in options) {
8856
8879
  this.updateTheme();
8857
8880
  }
@@ -8866,6 +8889,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8866
8889
  }
8867
8890
  }
8868
8891
  }
8892
+ updateDragAndDropState() {
8893
+ // Update draggable state for all tabs and void containers
8894
+ for (const group of this.groups) {
8895
+ group.model.updateDragAndDropState();
8896
+ }
8897
+ }
8869
8898
  focus() {
8870
8899
  var _a;
8871
8900
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();