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
  */
@@ -125,7 +125,7 @@ define(['exports'], (function (exports) { 'use strict';
125
125
  this.value = value;
126
126
  }
127
127
  print() {
128
- console.warn(this.value);
128
+ console.warn('dockview: stacktrace', this.value);
129
129
  }
130
130
  }
131
131
  class Listener {
@@ -190,7 +190,7 @@ define(['exports'], (function (exports) { 'use strict';
190
190
  var _a;
191
191
  // don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
192
192
  for (const listener of this._listeners) {
193
- console.warn((_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
193
+ console.warn('dockview: stacktrace', (_a = listener.stacktrace) === null || _a === void 0 ? void 0 : _a.print());
194
194
  }
195
195
  });
196
196
  }
@@ -5740,8 +5740,7 @@ define(['exports'], (function (exports) { 'use strict';
5740
5740
  }
5741
5741
  }
5742
5742
 
5743
- // TODO find a better way to initialize and avoid needing null checks
5744
- const NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
5743
+ const NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
5745
5744
  class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
5746
5745
  get location() {
5747
5746
  if (!this._group) {
@@ -5814,14 +5813,14 @@ define(['exports'], (function (exports) { 'use strict';
5814
5813
  }
5815
5814
  }
5816
5815
  initialize(group) {
5817
- this._group = group;
5818
5816
  /**
5819
- * TODO: Annoying initialization order caveat
5817
+ * TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
5820
5818
  *
5821
5819
  * Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
5822
5820
  * By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
5823
5821
  * finished ensuring the `model` is defined.
5824
5822
  */
5823
+ this._group = group;
5825
5824
  queueMicrotask(() => {
5826
5825
  this._mutableDisposable.value =
5827
5826
  this._group.model.onDidActivePanelChange((event) => {
@@ -5975,12 +5974,10 @@ define(['exports'], (function (exports) { 'use strict';
5975
5974
  var _a;
5976
5975
  let _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
5977
5976
  this.groupEventsDisposable.value = new CompositeDisposable(this.group.api.onDidVisibilityChange((event) => {
5978
- if (!event.isVisible && this.isVisible) {
5979
- this._onDidVisibilityChange.fire(event);
5980
- }
5981
- else if (event.isVisible &&
5982
- !this.isVisible &&
5983
- this.group.model.isPanelActive(this.panel)) {
5977
+ const hasBecomeHidden = !event.isVisible && this.isVisible;
5978
+ const hasBecomeVisible = event.isVisible && !this.isVisible;
5979
+ const isActivePanel = this.group.model.isPanelActive(this.panel);
5980
+ if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
5984
5981
  this._onDidVisibilityChange.fire(event);
5985
5982
  }
5986
5983
  }), this.group.api.onDidLocationChange((event) => {
@@ -6066,12 +6063,6 @@ define(['exports'], (function (exports) { 'use strict';
6066
6063
  const didTitleChange = title !== this.title;
6067
6064
  if (didTitleChange) {
6068
6065
  this._title = title;
6069
- this.view.update({
6070
- params: {
6071
- params: this._params,
6072
- title: this.title,
6073
- },
6074
- });
6075
6066
  this.api._onDidTitleChange.fire({ title });
6076
6067
  }
6077
6068
  }
@@ -6099,10 +6090,7 @@ define(['exports'], (function (exports) { 'use strict';
6099
6090
  }
6100
6091
  // update the view with the updated props
6101
6092
  this.view.update({
6102
- params: {
6103
- params: this._params,
6104
- title: this.title,
6105
- },
6093
+ params: this._params,
6106
6094
  });
6107
6095
  }
6108
6096
  updateParentGroup(group, options) {
@@ -7240,7 +7228,7 @@ define(['exports'], (function (exports) { 'use strict';
7240
7228
  return element.getBoundingClientRect();
7241
7229
  }
7242
7230
  const box = getBox();
7243
- 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;
7231
+ 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();
7244
7232
  if (itemToPopout.api.location.type === 'grid') {
7245
7233
  itemToPopout.api.setVisible(false);
7246
7234
  }
@@ -7356,24 +7344,22 @@ define(['exports'], (function (exports) { 'use strict';
7356
7344
  });
7357
7345
  }
7358
7346
  }
7359
- else {
7360
- if (this.getPanel(group.id)) {
7361
- const removedGroup = this.doRemoveGroup(group, {
7362
- skipDispose: true,
7363
- skipActive: true,
7364
- });
7365
- removedGroup.model.renderContainer =
7366
- this.overlayRenderContainer;
7367
- removedGroup.model.location = { type: 'grid' };
7368
- returnedGroup = removedGroup;
7369
- }
7347
+ else if (this.getPanel(group.id)) {
7348
+ const removedGroup = this.doRemoveGroup(group, {
7349
+ skipDispose: true,
7350
+ skipActive: true,
7351
+ });
7352
+ removedGroup.model.renderContainer =
7353
+ this.overlayRenderContainer;
7354
+ removedGroup.model.location = { type: 'grid' };
7355
+ returnedGroup = removedGroup;
7370
7356
  }
7371
7357
  }));
7372
7358
  this._popoutGroups.push(value);
7373
7359
  this.updateWatermark();
7374
7360
  })
7375
7361
  .catch((err) => {
7376
- console.error(err);
7362
+ console.error('dockview: failed to create popout window', err);
7377
7363
  });
7378
7364
  }
7379
7365
  addFloatingGroup(item, coord, options) {
@@ -7416,7 +7402,7 @@ define(['exports'], (function (exports) { 'use strict';
7416
7402
  this.doRemoveGroup(item, {
7417
7403
  skipDispose: true,
7418
7404
  skipPopoutReturn: true,
7419
- skipPopoutAssociated: !!popoutReferenceGroup,
7405
+ skipPopoutAssociated: false,
7420
7406
  });
7421
7407
  }
7422
7408
  }
@@ -7776,7 +7762,6 @@ define(['exports'], (function (exports) { 'use strict';
7776
7762
  clear() {
7777
7763
  const groups = Array.from(this._groups.values()).map((_) => _.value);
7778
7764
  const hasActiveGroup = !!this.activeGroup;
7779
- !!this.activePanel;
7780
7765
  for (const group of groups) {
7781
7766
  // remove the group will automatically remove the panels
7782
7767
  this.removeGroup(group, { skipActive: true });
@@ -8282,7 +8267,7 @@ define(['exports'], (function (exports) { 'use strict';
8282
8267
  }
8283
8268
  let id = options === null || options === void 0 ? void 0 : options.id;
8284
8269
  if (id && this._groups.has(options.id)) {
8285
- console.warn(`Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8270
+ console.warn(`dockview: Duplicate group id ${options === null || options === void 0 ? void 0 : options.id}. reassigning group id to avoid errors`);
8286
8271
  id = undefined;
8287
8272
  }
8288
8273
  if (!id) {