dockview-core 4.3.0 → 4.4.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 (33) hide show
  1. package/dist/cjs/api/component.api.d.ts +1 -0
  2. package/dist/cjs/api/component.api.js +7 -0
  3. package/dist/cjs/dockview/dockviewComponent.d.ts +3 -0
  4. package/dist/cjs/dockview/dockviewComponent.js +29 -12
  5. package/dist/cjs/events.js +7 -4
  6. package/dist/dockview-core.amd.js +35 -14
  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 +35 -14
  13. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  14. package/dist/dockview-core.cjs.js +35 -14
  15. package/dist/dockview-core.cjs.js.map +1 -1
  16. package/dist/dockview-core.esm.js +35 -14
  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 +35 -14
  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 +35 -14
  27. package/dist/dockview-core.noStyle.js.map +1 -1
  28. package/dist/esm/api/component.api.d.ts +1 -0
  29. package/dist/esm/api/component.api.js +3 -0
  30. package/dist/esm/dockview/dockviewComponent.d.ts +3 -0
  31. package/dist/esm/dockview/dockviewComponent.js +27 -12
  32. package/dist/esm/events.js +4 -1
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 4.3.0
3
+ * @version 4.4.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -221,7 +221,10 @@
221
221
  return this._event;
222
222
  }
223
223
  fire(e) {
224
- this._last = e;
224
+ var _a;
225
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) {
226
+ this._last = e;
227
+ }
225
228
  for (const listener of this._listeners) {
226
229
  listener.callback(e);
227
230
  }
@@ -3653,6 +3656,9 @@
3653
3656
  get onDidPopoutGroupPositionChange() {
3654
3657
  return this.component.onDidPopoutGroupPositionChange;
3655
3658
  }
3659
+ get onDidOpenPopoutWindowFail() {
3660
+ return this.component.onDidOpenPopoutWindowFail;
3661
+ }
3656
3662
  /**
3657
3663
  * All panel objects.
3658
3664
  */
@@ -8255,9 +8261,11 @@
8255
8261
  this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
8256
8262
  this._onDidPopoutGroupPositionChange = new Emitter();
8257
8263
  this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8264
+ this._onDidOpenPopoutWindowFail = new Emitter();
8265
+ this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
8258
8266
  this._onDidLayoutFromJSON = new Emitter();
8259
8267
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
8260
- this._onDidActivePanelChange = new Emitter();
8268
+ this._onDidActivePanelChange = new Emitter({ replay: true });
8261
8269
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
8262
8270
  this._onDidMovePanel = new Emitter();
8263
8271
  this.onDidMovePanel = this._onDidMovePanel.event;
@@ -8319,7 +8327,7 @@
8319
8327
  if (options.debug) {
8320
8328
  this.addDisposables(new StrictEventsSequencing(this));
8321
8329
  }
8322
- this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8330
+ this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
8323
8331
  this.updateWatermark();
8324
8332
  }), this.onDidAdd((event) => {
8325
8333
  if (!this._moving) {
@@ -8465,13 +8473,6 @@
8465
8473
  if (_window.isDisposed) {
8466
8474
  return false;
8467
8475
  }
8468
- if (popoutContainer === null) {
8469
- popoutWindowDisposable.dispose();
8470
- return false;
8471
- }
8472
- const gready = document.createElement('div');
8473
- gready.className = 'dv-overlay-render-container';
8474
- const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8475
8476
  const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
8476
8477
  ? options.referenceGroup
8477
8478
  : itemToPopout instanceof DockviewPanel
@@ -8479,7 +8480,7 @@
8479
8480
  : itemToPopout;
8480
8481
  const referenceLocation = itemToPopout.api.location.type;
8481
8482
  /**
8482
- * The group that is being added doesn't already exist within the DOM, the most likely occurance
8483
+ * The group that is being added doesn't already exist within the DOM, the most likely occurrence
8483
8484
  * of this case is when being called from the `fromJSON(...)` method
8484
8485
  */
8485
8486
  const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
@@ -8492,8 +8493,28 @@
8492
8493
  }
8493
8494
  else {
8494
8495
  group = this.createGroup({ id: groupId });
8495
- this._onDidAddGroup.fire(group);
8496
+ if (popoutContainer) {
8497
+ this._onDidAddGroup.fire(group);
8498
+ }
8496
8499
  }
8500
+ if (popoutContainer === null) {
8501
+ console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
8502
+ popoutWindowDisposable.dispose();
8503
+ this._onDidOpenPopoutWindowFail.fire();
8504
+ // if the popout window was blocked, we need to move the group back to the reference group
8505
+ // and set it to visible
8506
+ this.movingLock(() => moveGroupWithoutDestroying({
8507
+ from: group,
8508
+ to: referenceGroup,
8509
+ }));
8510
+ if (!referenceGroup.api.isVisible) {
8511
+ referenceGroup.api.setVisible(true);
8512
+ }
8513
+ return false;
8514
+ }
8515
+ const gready = document.createElement('div');
8516
+ gready.className = 'dv-overlay-render-container';
8517
+ const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8497
8518
  group.model.renderContainer = overlayRenderContainer;
8498
8519
  group.layout(_window.window.innerWidth, _window.window.innerHeight);
8499
8520
  let floatingBox;
@@ -8650,7 +8671,7 @@
8650
8671
  return true;
8651
8672
  })
8652
8673
  .catch((err) => {
8653
- console.error('dockview: failed to create popout window', err);
8674
+ console.error('dockview: failed to create popout.', err);
8654
8675
  return false;
8655
8676
  });
8656
8677
  }