dockview-core 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.
Files changed (34) hide show
  1. package/dist/cjs/dockview/components/titlebar/tabs.js +9 -3
  2. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +1 -1
  3. package/dist/cjs/dockview/dockviewComponent.js +37 -38
  4. package/dist/cjs/dockview/options.d.ts +7 -0
  5. package/dist/cjs/dockview/options.js +1 -0
  6. package/dist/dockview-core.amd.js +50 -44
  7. package/dist/dockview-core.amd.js.map +1 -1
  8. package/dist/dockview-core.amd.min.js +2 -2
  9. package/dist/dockview-core.amd.min.js.map +1 -1
  10. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  11. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  12. package/dist/dockview-core.amd.noStyle.js +49 -43
  13. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  14. package/dist/dockview-core.cjs.js +50 -44
  15. package/dist/dockview-core.cjs.js.map +1 -1
  16. package/dist/dockview-core.esm.js +50 -44
  17. package/dist/dockview-core.esm.js.map +1 -1
  18. package/dist/dockview-core.esm.min.js +2 -2
  19. package/dist/dockview-core.esm.min.js.map +1 -1
  20. package/dist/dockview-core.js +50 -44
  21. package/dist/dockview-core.js.map +1 -1
  22. package/dist/dockview-core.min.js +2 -2
  23. package/dist/dockview-core.min.js.map +1 -1
  24. package/dist/dockview-core.min.noStyle.js +2 -2
  25. package/dist/dockview-core.min.noStyle.js.map +1 -1
  26. package/dist/dockview-core.noStyle.js +49 -43
  27. package/dist/dockview-core.noStyle.js.map +1 -1
  28. package/dist/esm/dockview/components/titlebar/tabs.js +9 -3
  29. package/dist/esm/dockview/components/titlebar/tabsContainer.js +1 -1
  30. package/dist/esm/dockview/dockviewComponent.js +37 -38
  31. package/dist/esm/dockview/options.d.ts +7 -0
  32. package/dist/esm/dockview/options.js +1 -0
  33. package/dist/styles/dockview.css +16 -10
  34. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
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
  })();
@@ -8191,13 +8198,48 @@
8191
8198
  this._onDidActiveGroupChange = new Emitter();
8192
8199
  this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
8193
8200
  this._moving = false;
8201
+ this._options = options;
8194
8202
  this.popupService = new PopupService(this.element);
8195
- this.updateDropTargetModel(options);
8196
8203
  this._themeClassnames = new Classnames(this.element);
8204
+ this._api = new DockviewApi(this);
8197
8205
  this.rootDropTargetContainer = new DropTargetAnchorContainer(this.element, { disabled: true });
8198
8206
  this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
8207
+ this._rootDropTarget = new Droptarget(this.element, {
8208
+ className: 'dv-drop-target-edge',
8209
+ canDisplayOverlay: (event, position) => {
8210
+ const data = getPanelData();
8211
+ if (data) {
8212
+ if (data.viewId !== this.id) {
8213
+ return false;
8214
+ }
8215
+ if (position === 'center') {
8216
+ // center drop target is only allowed if there are no panels in the grid
8217
+ // floating panels are allowed
8218
+ return this.gridview.length === 0;
8219
+ }
8220
+ return true;
8221
+ }
8222
+ if (position === 'center' && this.gridview.length !== 0) {
8223
+ /**
8224
+ * for external events only show the four-corner drag overlays, disable
8225
+ * the center position so that external drag events can fall through to the group
8226
+ * and panel drop target handlers
8227
+ */
8228
+ return false;
8229
+ }
8230
+ const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8231
+ this._onUnhandledDragOverEvent.fire(firedEvent);
8232
+ return firedEvent.isAccepted;
8233
+ },
8234
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8235
+ overlayModel: (_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8236
+ getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8237
+ });
8238
+ this.updateDropTargetModel(options);
8199
8239
  toggleClass(this.gridview.element, 'dv-dockview', true);
8200
8240
  toggleClass(this.element, 'dv-debug', !!options.debug);
8241
+ this.updateTheme();
8242
+ this.updateWatermark();
8201
8243
  if (options.debug) {
8202
8244
  this.addDisposables(new StrictEventsSequencing(this));
8203
8245
  }
@@ -8233,41 +8275,7 @@
8233
8275
  for (const group of [...this._popoutGroups]) {
8234
8276
  group.disposable.dispose();
8235
8277
  }
8236
- }));
8237
- this._options = options;
8238
- this.updateTheme();
8239
- this._rootDropTarget = new Droptarget(this.element, {
8240
- className: 'dv-drop-target-edge',
8241
- canDisplayOverlay: (event, position) => {
8242
- const data = getPanelData();
8243
- if (data) {
8244
- if (data.viewId !== this.id) {
8245
- return false;
8246
- }
8247
- if (position === 'center') {
8248
- // center drop target is only allowed if there are no panels in the grid
8249
- // floating panels are allowed
8250
- return this.gridview.length === 0;
8251
- }
8252
- return true;
8253
- }
8254
- if (position === 'center' && this.gridview.length !== 0) {
8255
- /**
8256
- * for external events only show the four-corner drag overlays, disable
8257
- * the center position so that external drag events can fall through to the group
8258
- * and panel drop target handlers
8259
- */
8260
- return false;
8261
- }
8262
- const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8263
- this._onUnhandledDragOverEvent.fire(firedEvent);
8264
- return firedEvent.isAccepted;
8265
- },
8266
- acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8267
- overlayModel: (_c = this.options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8268
- getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8269
- });
8270
- this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8278
+ }), this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8271
8279
  if (this.gridview.length > 0 && event.position === 'center') {
8272
8280
  // option only available when no panels in primary grid
8273
8281
  return;
@@ -8318,8 +8326,6 @@
8318
8326
  }));
8319
8327
  }
8320
8328
  }), this._rootDropTarget);
8321
- this._api = new DockviewApi(this);
8322
- this.updateWatermark();
8323
8329
  }
8324
8330
  setVisible(panel, visible) {
8325
8331
  switch (panel.api.location.type) {