dockview-react 4.1.0 → 4.2.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.1.0
3
+ * @version 4.2.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -5220,9 +5220,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5220
5220
  this._tabsList = document.createElement('div');
5221
5221
  this._tabsList.className = 'dv-tabs-container dv-horizontal';
5222
5222
  this.showTabsOverflowControl = options.showTabsOverflowControl;
5223
- const scrollbar = new Scrollbar(this._tabsList);
5224
- this._element = scrollbar.element;
5225
- this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, scrollbar, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
5223
+ if (accessor.options.scrollbars === 'native') {
5224
+ this._element = this._tabsList;
5225
+ }
5226
+ else {
5227
+ const scrollbar = new Scrollbar(this._tabsList);
5228
+ this._element = scrollbar.element;
5229
+ this.addDisposables(scrollbar);
5230
+ }
5231
+ this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
5226
5232
  if (event.defaultPrevented) {
5227
5233
  return;
5228
5234
  }
@@ -5447,7 +5453,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5447
5453
  this._element.appendChild(this.leftActionsContainer);
5448
5454
  this._element.appendChild(this.voidContainer.element);
5449
5455
  this._element.appendChild(this.rightActionsContainer);
5450
- this.addDisposables(accessor.onDidOptionsChange(() => {
5456
+ this.addDisposables(this.tabs.onDrop((e) => this._onDrop.fire(e)), this.tabs.onWillShowOverlay((e) => this._onWillShowOverlay.fire(e)), accessor.onDidOptionsChange(() => {
5451
5457
  this.tabs.showTabsOverflowControl =
5452
5458
  !accessor.options.disableTabsOverflowList;
5453
5459
  }), this.tabs.onOverflowTabsChange((event) => {
@@ -5647,6 +5653,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5647
5653
  dndEdges: undefined,
5648
5654
  theme: undefined,
5649
5655
  disableTabsOverflowList: undefined,
5656
+ scrollbars: undefined,
5650
5657
  };
5651
5658
  return Object.keys(properties);
5652
5659
  })();
@@ -8164,13 +8171,48 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8164
8171
  this._onDidActiveGroupChange = new Emitter();
8165
8172
  this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
8166
8173
  this._moving = false;
8174
+ this._options = options;
8167
8175
  this.popupService = new PopupService(this.element);
8168
- this.updateDropTargetModel(options);
8169
8176
  this._themeClassnames = new Classnames(this.element);
8177
+ this._api = new DockviewApi(this);
8170
8178
  this.rootDropTargetContainer = new DropTargetAnchorContainer(this.element, { disabled: true });
8171
8179
  this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
8180
+ this._rootDropTarget = new Droptarget(this.element, {
8181
+ className: 'dv-drop-target-edge',
8182
+ canDisplayOverlay: (event, position) => {
8183
+ const data = getPanelData();
8184
+ if (data) {
8185
+ if (data.viewId !== this.id) {
8186
+ return false;
8187
+ }
8188
+ if (position === 'center') {
8189
+ // center drop target is only allowed if there are no panels in the grid
8190
+ // floating panels are allowed
8191
+ return this.gridview.length === 0;
8192
+ }
8193
+ return true;
8194
+ }
8195
+ if (position === 'center' && this.gridview.length !== 0) {
8196
+ /**
8197
+ * for external events only show the four-corner drag overlays, disable
8198
+ * the center position so that external drag events can fall through to the group
8199
+ * and panel drop target handlers
8200
+ */
8201
+ return false;
8202
+ }
8203
+ const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8204
+ this._onUnhandledDragOverEvent.fire(firedEvent);
8205
+ return firedEvent.isAccepted;
8206
+ },
8207
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8208
+ overlayModel: (_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8209
+ getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8210
+ });
8211
+ this.updateDropTargetModel(options);
8172
8212
  toggleClass(this.gridview.element, 'dv-dockview', true);
8173
8213
  toggleClass(this.element, 'dv-debug', !!options.debug);
8214
+ this.updateTheme();
8215
+ this.updateWatermark();
8174
8216
  if (options.debug) {
8175
8217
  this.addDisposables(new StrictEventsSequencing(this));
8176
8218
  }
@@ -8206,41 +8248,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8206
8248
  for (const group of [...this._popoutGroups]) {
8207
8249
  group.disposable.dispose();
8208
8250
  }
8209
- }));
8210
- this._options = options;
8211
- this.updateTheme();
8212
- this._rootDropTarget = new Droptarget(this.element, {
8213
- className: 'dv-drop-target-edge',
8214
- canDisplayOverlay: (event, position) => {
8215
- const data = getPanelData();
8216
- if (data) {
8217
- if (data.viewId !== this.id) {
8218
- return false;
8219
- }
8220
- if (position === 'center') {
8221
- // center drop target is only allowed if there are no panels in the grid
8222
- // floating panels are allowed
8223
- return this.gridview.length === 0;
8224
- }
8225
- return true;
8226
- }
8227
- if (position === 'center' && this.gridview.length !== 0) {
8228
- /**
8229
- * for external events only show the four-corner drag overlays, disable
8230
- * the center position so that external drag events can fall through to the group
8231
- * and panel drop target handlers
8232
- */
8233
- return false;
8234
- }
8235
- const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8236
- this._onUnhandledDragOverEvent.fire(firedEvent);
8237
- return firedEvent.isAccepted;
8238
- },
8239
- acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8240
- overlayModel: (_c = this.options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8241
- getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8242
- });
8243
- this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8251
+ }), this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8244
8252
  if (this.gridview.length > 0 && event.position === 'center') {
8245
8253
  // option only available when no panels in primary grid
8246
8254
  return;
@@ -8291,8 +8299,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
8291
8299
  }));
8292
8300
  }
8293
8301
  }), this._rootDropTarget);
8294
- this._api = new DockviewApi(this);
8295
- this.updateWatermark();
8296
8302
  }
8297
8303
  setVisible(panel, visible) {
8298
8304
  switch (panel.api.location.type) {