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
  */
@@ -129,7 +129,7 @@
129
129
  this.value = value;
130
130
  }
131
131
  print() {
132
- console.warn(this.value);
132
+ console.warn('dockview: stacktrace', this.value);
133
133
  }
134
134
  }
135
135
  class Listener {
@@ -194,7 +194,7 @@
194
194
  var _a;
195
195
  // don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
196
196
  for (const listener of this._listeners) {
197
- console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
197
+ console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
198
198
  }
199
199
  });
200
200
  }
@@ -5744,8 +5744,7 @@
5744
5744
  }
5745
5745
  }
5746
5746
 
5747
- // TODO find a better way to initialize and avoid needing null checks
5748
- const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
5747
+ const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
5749
5748
  class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5750
5749
  get location() {
5751
5750
  if (!this._group) {
@@ -5818,14 +5817,14 @@
5818
5817
  }
5819
5818
  }
5820
5819
  initialize(group) {
5821
- this._group = group;
5822
5820
  /**
5823
- * TODO: Annoying initialization order caveat
5821
+ * TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
5824
5822
  *
5825
5823
  * Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
5826
5824
  * By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
5827
5825
  * finished ensuring the `model` is defined.
5828
5826
  */
5827
+ this._group = group;
5829
5828
  queueMicrotask(() => {
5830
5829
  this._mutableDisposable.value =
5831
5830
  this._group.model.onDidActivePanelChange((event) => {
@@ -5979,12 +5978,10 @@
5979
5978
  var _a;
5980
5979
  let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
5981
5980
  this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
5982
- if (!event.isVisible && this.isVisible) {
5983
- this._onDidVisibilityChange.fire(event);
5984
- }
5985
- else if (event.isVisible &&
5986
- !this.isVisible &&
5987
- this.group.model.isPanelActive(this.panel)) {
5981
+ const hasBecomeHidden = !event.isVisible && this.isVisible;
5982
+ const hasBecomeVisible = event.isVisible && !this.isVisible;
5983
+ const isActivePanel = this.group.model.isPanelActive(this.panel);
5984
+ if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
5988
5985
  this._onDidVisibilityChange.fire(event);
5989
5986
  }
5990
5987
  }), this.group.api.onDidLocationChange((event) => {
@@ -6070,12 +6067,6 @@
6070
6067
  const didTitleChange = title !== this.title;
6071
6068
  if (didTitleChange) {
6072
6069
  this._title = title;
6073
- this.view.update({
6074
- params: {
6075
- params: this._params,
6076
- title: this.title,
6077
- },
6078
- });
6079
6070
  this.api._onDidTitleChange.fire({ title });
6080
6071
  }
6081
6072
  }
@@ -6103,10 +6094,7 @@
6103
6094
  }
6104
6095
  // update the view with the updated props
6105
6096
  this.view.update({
6106
- params: {
6107
- params: this._params,
6108
- title: this.title,
6109
- },
6097
+ params: this._params,
6110
6098
  });
6111
6099
  }
6112
6100
  updateParentGroup(group, options) {
@@ -7244,7 +7232,7 @@
7244
7232
  return element.getBoundingClientRect();
7245
7233
  }
7246
7234
  const box = getBox();
7247
- 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;
7235
+ 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();
7248
7236
  if (itemToPopout.api.location.type === 'grid') {
7249
7237
  itemToPopout.api.setVisible(false);
7250
7238
  }
@@ -7360,24 +7348,22 @@
7360
7348
  });
7361
7349
  }
7362
7350
  }
7363
- else {
7364
- if (this.getPanel(group.id)) {
7365
- const removedGroup = this.doRemoveGroup(group, {
7366
- skipDispose: true,
7367
- skipActive: true,
7368
- });
7369
- removedGroup.model.renderContainer =
7370
- this.overlayRenderContainer;
7371
- removedGroup.model.location = { type: 'grid' };
7372
- returnedGroup = removedGroup;
7373
- }
7351
+ else if (this.getPanel(group.id)) {
7352
+ const removedGroup = this.doRemoveGroup(group, {
7353
+ skipDispose: true,
7354
+ skipActive: true,
7355
+ });
7356
+ removedGroup.model.renderContainer =
7357
+ this.overlayRenderContainer;
7358
+ removedGroup.model.location = { type: 'grid' };
7359
+ returnedGroup = removedGroup;
7374
7360
  }
7375
7361
  }));
7376
7362
  this._popoutGroups.push(value);
7377
7363
  this.updateWatermark();
7378
7364
  })
7379
7365
  .catch((err) => {
7380
- console.error(err);
7366
+ console.error('dockview: failed to create popout window', err);
7381
7367
  });
7382
7368
  }
7383
7369
  addFloatingGroup(item, coord, options) {
@@ -7420,7 +7406,7 @@
7420
7406
  this.doRemoveGroup(item, {
7421
7407
  skipDispose: true,
7422
7408
  skipPopoutReturn: true,
7423
- skipPopoutAssociated: !!popoutReferenceGroup,
7409
+ skipPopoutAssociated: false,
7424
7410
  });
7425
7411
  }
7426
7412
  }
@@ -7780,7 +7766,6 @@
7780
7766
  clear() {
7781
7767
  const groups = Array.from(this._groups.values()).map((_) => _.value);
7782
7768
  const hasActiveGroup = !!this.activeGroup;
7783
- !!this.activePanel;
7784
7769
  for (const group of groups) {
7785
7770
  // remove the group will automatically remove the panels
7786
7771
  this.removeGroup(group, { skipActive: true });
@@ -8286,7 +8271,7 @@
8286
8271
  }
8287
8272
  let id = options === null || options === void 0 ? void 0 : options.id;
8288
8273
  if (id && this._groups.has(options.id)) {
8289
- console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8274
+ console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8290
8275
  id = undefined;
8291
8276
  }
8292
8277
  if (!id) {