dockview-core 4.3.1 → 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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 4.3.1
3
+ * @version 4.4.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -3622,6 +3622,9 @@ define(['exports'], (function (exports) { 'use strict';
3622
3622
  get onDidPopoutGroupPositionChange() {
3623
3623
  return this.component.onDidPopoutGroupPositionChange;
3624
3624
  }
3625
+ get onDidOpenPopoutWindowFail() {
3626
+ return this.component.onDidOpenPopoutWindowFail;
3627
+ }
3625
3628
  /**
3626
3629
  * All panel objects.
3627
3630
  */
@@ -8224,6 +8227,8 @@ define(['exports'], (function (exports) { 'use strict';
8224
8227
  this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
8225
8228
  this._onDidPopoutGroupPositionChange = new Emitter();
8226
8229
  this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8230
+ this._onDidOpenPopoutWindowFail = new Emitter();
8231
+ this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
8227
8232
  this._onDidLayoutFromJSON = new Emitter();
8228
8233
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
8229
8234
  this._onDidActivePanelChange = new Emitter({ replay: true });
@@ -8288,7 +8293,7 @@ define(['exports'], (function (exports) { 'use strict';
8288
8293
  if (options.debug) {
8289
8294
  this.addDisposables(new StrictEventsSequencing(this));
8290
8295
  }
8291
- 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(() => {
8296
+ 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(() => {
8292
8297
  this.updateWatermark();
8293
8298
  }), this.onDidAdd((event) => {
8294
8299
  if (!this._moving) {
@@ -8434,13 +8439,6 @@ define(['exports'], (function (exports) { 'use strict';
8434
8439
  if (_window.isDisposed) {
8435
8440
  return false;
8436
8441
  }
8437
- if (popoutContainer === null) {
8438
- popoutWindowDisposable.dispose();
8439
- return false;
8440
- }
8441
- const gready = document.createElement('div');
8442
- gready.className = 'dv-overlay-render-container';
8443
- const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8444
8442
  const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
8445
8443
  ? options.referenceGroup
8446
8444
  : itemToPopout instanceof DockviewPanel
@@ -8448,7 +8446,7 @@ define(['exports'], (function (exports) { 'use strict';
8448
8446
  : itemToPopout;
8449
8447
  const referenceLocation = itemToPopout.api.location.type;
8450
8448
  /**
8451
- * The group that is being added doesn't already exist within the DOM, the most likely occurance
8449
+ * The group that is being added doesn't already exist within the DOM, the most likely occurrence
8452
8450
  * of this case is when being called from the `fromJSON(...)` method
8453
8451
  */
8454
8452
  const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
@@ -8461,8 +8459,28 @@ define(['exports'], (function (exports) { 'use strict';
8461
8459
  }
8462
8460
  else {
8463
8461
  group = this.createGroup({ id: groupId });
8464
- this._onDidAddGroup.fire(group);
8462
+ if (popoutContainer) {
8463
+ this._onDidAddGroup.fire(group);
8464
+ }
8465
8465
  }
8466
+ if (popoutContainer === null) {
8467
+ console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
8468
+ popoutWindowDisposable.dispose();
8469
+ this._onDidOpenPopoutWindowFail.fire();
8470
+ // if the popout window was blocked, we need to move the group back to the reference group
8471
+ // and set it to visible
8472
+ this.movingLock(() => moveGroupWithoutDestroying({
8473
+ from: group,
8474
+ to: referenceGroup,
8475
+ }));
8476
+ if (!referenceGroup.api.isVisible) {
8477
+ referenceGroup.api.setVisible(true);
8478
+ }
8479
+ return false;
8480
+ }
8481
+ const gready = document.createElement('div');
8482
+ gready.className = 'dv-overlay-render-container';
8483
+ const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8466
8484
  group.model.renderContainer = overlayRenderContainer;
8467
8485
  group.layout(_window.window.innerWidth, _window.window.innerHeight);
8468
8486
  let floatingBox;
@@ -8619,7 +8637,7 @@ define(['exports'], (function (exports) { 'use strict';
8619
8637
  return true;
8620
8638
  })
8621
8639
  .catch((err) => {
8622
- console.error('dockview: failed to create popout window', err);
8640
+ console.error('dockview: failed to create popout.', err);
8623
8641
  return false;
8624
8642
  });
8625
8643
  }