dockview-core 1.13.1 → 1.14.0

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/api/dockviewGroupPanelApi.js +4 -5
  2. package/dist/cjs/api/dockviewPanelApi.js +4 -6
  3. package/dist/cjs/dockview/dockviewComponent.js +13 -16
  4. package/dist/cjs/dockview/dockviewPanel.js +1 -10
  5. package/dist/cjs/events.js +3 -3
  6. package/dist/dockview-core.amd.js +24 -39
  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 +24 -39
  13. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  14. package/dist/dockview-core.cjs.js +24 -39
  15. package/dist/dockview-core.cjs.js.map +1 -1
  16. package/dist/dockview-core.esm.js +24 -39
  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 +24 -39
  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 +24 -39
  27. package/dist/dockview-core.noStyle.js.map +1 -1
  28. package/dist/esm/api/dockviewGroupPanelApi.js +3 -4
  29. package/dist/esm/api/dockviewPanelApi.js +4 -6
  30. package/dist/esm/dockview/components/titlebar/tabsContainer.js +1 -1
  31. package/dist/esm/dockview/dockviewComponent.js +13 -16
  32. package/dist/esm/dockview/dockviewPanel.js +1 -10
  33. package/dist/esm/events.js +3 -3
  34. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.13.1
3
+ * @version 1.14.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -155,7 +155,7 @@ class Stacktrace {
155
155
  this.value = value;
156
156
  }
157
157
  print() {
158
- console.warn(this.value);
158
+ console.warn('dockview: stacktrace', this.value);
159
159
  }
160
160
  }
161
161
  class Listener {
@@ -220,7 +220,7 @@ class Emitter {
220
220
  var _a;
221
221
  // don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
222
222
  for (const listener of this._listeners) {
223
- console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
223
+ console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
224
224
  }
225
225
  });
226
226
  }
@@ -5770,8 +5770,7 @@ class GridviewPanel extends BasePanelView {
5770
5770
  }
5771
5771
  }
5772
5772
 
5773
- // TODO find a better way to initialize and avoid needing null checks
5774
- const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
5773
+ const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
5775
5774
  class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5776
5775
  get location() {
5777
5776
  if (!this._group) {
@@ -5844,14 +5843,14 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5844
5843
  }
5845
5844
  }
5846
5845
  initialize(group) {
5847
- this._group = group;
5848
5846
  /**
5849
- * TODO: Annoying initialization order caveat
5847
+ * TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
5850
5848
  *
5851
5849
  * Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
5852
5850
  * By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
5853
5851
  * finished ensuring the `model` is defined.
5854
5852
  */
5853
+ this._group = group;
5855
5854
  queueMicrotask(() => {
5856
5855
  this._mutableDisposable.value =
5857
5856
  this._group.model.onDidActivePanelChange((event) => {
@@ -6005,12 +6004,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
6005
6004
  var _a;
6006
6005
  let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
6007
6006
  this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
6008
- if (!event.isVisible && this.isVisible) {
6009
- this._onDidVisibilityChange.fire(event);
6010
- }
6011
- else if (event.isVisible &&
6012
- !this.isVisible &&
6013
- this.group.model.isPanelActive(this.panel)) {
6007
+ const hasBecomeHidden = !event.isVisible && this.isVisible;
6008
+ const hasBecomeVisible = event.isVisible && !this.isVisible;
6009
+ const isActivePanel = this.group.model.isPanelActive(this.panel);
6010
+ if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
6014
6011
  this._onDidVisibilityChange.fire(event);
6015
6012
  }
6016
6013
  }), this.group.api.onDidLocationChange((event) => {
@@ -6096,12 +6093,6 @@ class DockviewPanel extends CompositeDisposable {
6096
6093
  const didTitleChange = title !== this.title;
6097
6094
  if (didTitleChange) {
6098
6095
  this._title = title;
6099
- this.view.update({
6100
- params: {
6101
- params: this._params,
6102
- title: this.title,
6103
- },
6104
- });
6105
6096
  this.api._onDidTitleChange.fire({ title });
6106
6097
  }
6107
6098
  }
@@ -6129,10 +6120,7 @@ class DockviewPanel extends CompositeDisposable {
6129
6120
  }
6130
6121
  // update the view with the updated props
6131
6122
  this.view.update({
6132
- params: {
6133
- params: this._params,
6134
- title: this.title,
6135
- },
6123
+ params: this._params,
6136
6124
  });
6137
6125
  }
6138
6126
  updateParentGroup(group, options) {
@@ -7270,7 +7258,7 @@ class DockviewComponent extends BaseGrid {
7270
7258
  return element.getBoundingClientRect();
7271
7259
  }
7272
7260
  const box = getBox();
7273
- const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId(); //item.id;
7261
+ const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
7274
7262
  if (itemToPopout.api.location.type === 'grid') {
7275
7263
  itemToPopout.api.setVisible(false);
7276
7264
  }
@@ -7386,24 +7374,22 @@ class DockviewComponent extends BaseGrid {
7386
7374
  });
7387
7375
  }
7388
7376
  }
7389
- else {
7390
- if (this.getPanel(group.id)) {
7391
- const removedGroup = this.doRemoveGroup(group, {
7392
- skipDispose: true,
7393
- skipActive: true,
7394
- });
7395
- removedGroup.model.renderContainer =
7396
- this.overlayRenderContainer;
7397
- removedGroup.model.location = { type: 'grid' };
7398
- returnedGroup = removedGroup;
7399
- }
7377
+ else if (this.getPanel(group.id)) {
7378
+ const removedGroup = this.doRemoveGroup(group, {
7379
+ skipDispose: true,
7380
+ skipActive: true,
7381
+ });
7382
+ removedGroup.model.renderContainer =
7383
+ this.overlayRenderContainer;
7384
+ removedGroup.model.location = { type: 'grid' };
7385
+ returnedGroup = removedGroup;
7400
7386
  }
7401
7387
  }));
7402
7388
  this._popoutGroups.push(value);
7403
7389
  this.updateWatermark();
7404
7390
  })
7405
7391
  .catch((err) => {
7406
- console.error(err);
7392
+ console.error('dockview: failed to create popout window', err);
7407
7393
  });
7408
7394
  }
7409
7395
  addFloatingGroup(item, coord, options) {
@@ -7446,7 +7432,7 @@ class DockviewComponent extends BaseGrid {
7446
7432
  this.doRemoveGroup(item, {
7447
7433
  skipDispose: true,
7448
7434
  skipPopoutReturn: true,
7449
- skipPopoutAssociated: !!popoutReferenceGroup,
7435
+ skipPopoutAssociated: false,
7450
7436
  });
7451
7437
  }
7452
7438
  }
@@ -7806,7 +7792,6 @@ class DockviewComponent extends BaseGrid {
7806
7792
  clear() {
7807
7793
  const groups = Array.from(this._groups.values()).map((_) => _.value);
7808
7794
  const hasActiveGroup = !!this.activeGroup;
7809
- !!this.activePanel;
7810
7795
  for (const group of groups) {
7811
7796
  // remove the group will automatically remove the panels
7812
7797
  this.removeGroup(group, { skipActive: true });
@@ -8312,7 +8297,7 @@ class DockviewComponent extends BaseGrid {
8312
8297
  }
8313
8298
  let id = options === null || options === void 0 ? void 0 : options.id;
8314
8299
  if (id && this._groups.has(options.id)) {
8315
- console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8300
+ console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8316
8301
  id = undefined;
8317
8302
  }
8318
8303
  if (!id) {