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
  */
@@ -5220,9 +5220,15 @@ define(['exports'], (function (exports) { 'use strict';
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'], (function (exports) { 'use strict';
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'], (function (exports) { 'use strict';
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
  })();
@@ -8187,13 +8194,48 @@ define(['exports'], (function (exports) { 'use strict';
8187
8194
  this._onDidActiveGroupChange = new Emitter();
8188
8195
  this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
8189
8196
  this._moving = false;
8197
+ this._options = options;
8190
8198
  this.popupService = new PopupService(this.element);
8191
- this.updateDropTargetModel(options);
8192
8199
  this._themeClassnames = new Classnames(this.element);
8200
+ this._api = new DockviewApi(this);
8193
8201
  this.rootDropTargetContainer = new DropTargetAnchorContainer(this.element, { disabled: true });
8194
8202
  this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
8203
+ this._rootDropTarget = new Droptarget(this.element, {
8204
+ className: 'dv-drop-target-edge',
8205
+ canDisplayOverlay: (event, position) => {
8206
+ const data = getPanelData();
8207
+ if (data) {
8208
+ if (data.viewId !== this.id) {
8209
+ return false;
8210
+ }
8211
+ if (position === 'center') {
8212
+ // center drop target is only allowed if there are no panels in the grid
8213
+ // floating panels are allowed
8214
+ return this.gridview.length === 0;
8215
+ }
8216
+ return true;
8217
+ }
8218
+ if (position === 'center' && this.gridview.length !== 0) {
8219
+ /**
8220
+ * for external events only show the four-corner drag overlays, disable
8221
+ * the center position so that external drag events can fall through to the group
8222
+ * and panel drop target handlers
8223
+ */
8224
+ return false;
8225
+ }
8226
+ const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8227
+ this._onUnhandledDragOverEvent.fire(firedEvent);
8228
+ return firedEvent.isAccepted;
8229
+ },
8230
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8231
+ overlayModel: (_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8232
+ getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8233
+ });
8234
+ this.updateDropTargetModel(options);
8195
8235
  toggleClass(this.gridview.element, 'dv-dockview', true);
8196
8236
  toggleClass(this.element, 'dv-debug', !!options.debug);
8237
+ this.updateTheme();
8238
+ this.updateWatermark();
8197
8239
  if (options.debug) {
8198
8240
  this.addDisposables(new StrictEventsSequencing(this));
8199
8241
  }
@@ -8229,41 +8271,7 @@ define(['exports'], (function (exports) { 'use strict';
8229
8271
  for (const group of [...this._popoutGroups]) {
8230
8272
  group.disposable.dispose();
8231
8273
  }
8232
- }));
8233
- this._options = options;
8234
- this.updateTheme();
8235
- this._rootDropTarget = new Droptarget(this.element, {
8236
- className: 'dv-drop-target-edge',
8237
- canDisplayOverlay: (event, position) => {
8238
- const data = getPanelData();
8239
- if (data) {
8240
- if (data.viewId !== this.id) {
8241
- return false;
8242
- }
8243
- if (position === 'center') {
8244
- // center drop target is only allowed if there are no panels in the grid
8245
- // floating panels are allowed
8246
- return this.gridview.length === 0;
8247
- }
8248
- return true;
8249
- }
8250
- if (position === 'center' && this.gridview.length !== 0) {
8251
- /**
8252
- * for external events only show the four-corner drag overlays, disable
8253
- * the center position so that external drag events can fall through to the group
8254
- * and panel drop target handlers
8255
- */
8256
- return false;
8257
- }
8258
- const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8259
- this._onUnhandledDragOverEvent.fire(firedEvent);
8260
- return firedEvent.isAccepted;
8261
- },
8262
- acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8263
- overlayModel: (_c = this.options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8264
- getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8265
- });
8266
- this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8274
+ }), this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8267
8275
  if (this.gridview.length > 0 && event.position === 'center') {
8268
8276
  // option only available when no panels in primary grid
8269
8277
  return;
@@ -8314,8 +8322,6 @@ define(['exports'], (function (exports) { 'use strict';
8314
8322
  }));
8315
8323
  }
8316
8324
  }), this._rootDropTarget);
8317
- this._api = new DockviewApi(this);
8318
- this.updateWatermark();
8319
8325
  }
8320
8326
  setVisible(panel, visible) {
8321
8327
  switch (panel.api.location.type) {