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