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
  */
@@ -153,7 +153,7 @@ class Stacktrace {
153
153
  this.value = value;
154
154
  }
155
155
  print() {
156
- console.warn(this.value);
156
+ console.warn('dockview: stacktrace', this.value);
157
157
  }
158
158
  }
159
159
  class Listener {
@@ -218,7 +218,7 @@ class Emitter {
218
218
  var _a;
219
219
  // don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
220
220
  for (const listener of this._listeners) {
221
- console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
221
+ console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
222
222
  }
223
223
  });
224
224
  }
@@ -5768,8 +5768,7 @@ class GridviewPanel extends BasePanelView {
5768
5768
  }
5769
5769
  }
5770
5770
 
5771
- // TODO find a better way to initialize and avoid needing null checks
5772
- const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
5771
+ const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
5773
5772
  class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5774
5773
  get location() {
5775
5774
  if (!this._group) {
@@ -5842,14 +5841,14 @@ class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5842
5841
  }
5843
5842
  }
5844
5843
  initialize(group) {
5845
- this._group = group;
5846
5844
  /**
5847
- * TODO: Annoying initialization order caveat
5845
+ * TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
5848
5846
  *
5849
5847
  * Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
5850
5848
  * By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
5851
5849
  * finished ensuring the `model` is defined.
5852
5850
  */
5851
+ this._group = group;
5853
5852
  queueMicrotask(() => {
5854
5853
  this._mutableDisposable.value =
5855
5854
  this._group.model.onDidActivePanelChange((event) => {
@@ -6003,12 +6002,10 @@ class DockviewPanelApiImpl extends GridviewPanelApiImpl {
6003
6002
  var _a;
6004
6003
  let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
6005
6004
  this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
6006
- if (!event.isVisible && this.isVisible) {
6007
- this._onDidVisibilityChange.fire(event);
6008
- }
6009
- else if (event.isVisible &&
6010
- !this.isVisible &&
6011
- this.group.model.isPanelActive(this.panel)) {
6005
+ const hasBecomeHidden = !event.isVisible && this.isVisible;
6006
+ const hasBecomeVisible = event.isVisible && !this.isVisible;
6007
+ const isActivePanel = this.group.model.isPanelActive(this.panel);
6008
+ if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
6012
6009
  this._onDidVisibilityChange.fire(event);
6013
6010
  }
6014
6011
  }), this.group.api.onDidLocationChange((event) => {
@@ -6094,12 +6091,6 @@ class DockviewPanel extends CompositeDisposable {
6094
6091
  const didTitleChange = title !== this.title;
6095
6092
  if (didTitleChange) {
6096
6093
  this._title = title;
6097
- this.view.update({
6098
- params: {
6099
- params: this._params,
6100
- title: this.title,
6101
- },
6102
- });
6103
6094
  this.api._onDidTitleChange.fire({ title });
6104
6095
  }
6105
6096
  }
@@ -6127,10 +6118,7 @@ class DockviewPanel extends CompositeDisposable {
6127
6118
  }
6128
6119
  // update the view with the updated props
6129
6120
  this.view.update({
6130
- params: {
6131
- params: this._params,
6132
- title: this.title,
6133
- },
6121
+ params: this._params,
6134
6122
  });
6135
6123
  }
6136
6124
  updateParentGroup(group, options) {
@@ -7268,7 +7256,7 @@ class DockviewComponent extends BaseGrid {
7268
7256
  return element.getBoundingClientRect();
7269
7257
  }
7270
7258
  const box = getBox();
7271
- 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;
7259
+ 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();
7272
7260
  if (itemToPopout.api.location.type === 'grid') {
7273
7261
  itemToPopout.api.setVisible(false);
7274
7262
  }
@@ -7384,24 +7372,22 @@ class DockviewComponent extends BaseGrid {
7384
7372
  });
7385
7373
  }
7386
7374
  }
7387
- else {
7388
- if (this.getPanel(group.id)) {
7389
- const removedGroup = this.doRemoveGroup(group, {
7390
- skipDispose: true,
7391
- skipActive: true,
7392
- });
7393
- removedGroup.model.renderContainer =
7394
- this.overlayRenderContainer;
7395
- removedGroup.model.location = { type: 'grid' };
7396
- returnedGroup = removedGroup;
7397
- }
7375
+ else if (this.getPanel(group.id)) {
7376
+ const removedGroup = this.doRemoveGroup(group, {
7377
+ skipDispose: true,
7378
+ skipActive: true,
7379
+ });
7380
+ removedGroup.model.renderContainer =
7381
+ this.overlayRenderContainer;
7382
+ removedGroup.model.location = { type: 'grid' };
7383
+ returnedGroup = removedGroup;
7398
7384
  }
7399
7385
  }));
7400
7386
  this._popoutGroups.push(value);
7401
7387
  this.updateWatermark();
7402
7388
  })
7403
7389
  .catch((err) => {
7404
- console.error(err);
7390
+ console.error('dockview: failed to create popout window', err);
7405
7391
  });
7406
7392
  }
7407
7393
  addFloatingGroup(item, coord, options) {
@@ -7444,7 +7430,7 @@ class DockviewComponent extends BaseGrid {
7444
7430
  this.doRemoveGroup(item, {
7445
7431
  skipDispose: true,
7446
7432
  skipPopoutReturn: true,
7447
- skipPopoutAssociated: !!popoutReferenceGroup,
7433
+ skipPopoutAssociated: false,
7448
7434
  });
7449
7435
  }
7450
7436
  }
@@ -7804,7 +7790,6 @@ class DockviewComponent extends BaseGrid {
7804
7790
  clear() {
7805
7791
  const groups = Array.from(this._groups.values()).map((_) => _.value);
7806
7792
  const hasActiveGroup = !!this.activeGroup;
7807
- !!this.activePanel;
7808
7793
  for (const group of groups) {
7809
7794
  // remove the group will automatically remove the panels
7810
7795
  this.removeGroup(group, { skipActive: true });
@@ -8310,7 +8295,7 @@ class DockviewComponent extends BaseGrid {
8310
8295
  }
8311
8296
  let id = options === null || options === void 0 ? void 0 : options.id;
8312
8297
  if (id && this._groups.has(options.id)) {
8313
- console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8298
+ console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8314
8299
  id = undefined;
8315
8300
  }
8316
8301
  if (!id) {