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
  */
@@ -187,7 +187,10 @@ define(['exports'], (function (exports) { 'use strict';
187
187
  return this._event;
188
188
  }
189
189
  fire(e) {
190
- this._last = e;
190
+ var _a;
191
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) {
192
+ this._last = e;
193
+ }
191
194
  for (const listener of this._listeners) {
192
195
  listener.callback(e);
193
196
  }
@@ -3619,6 +3622,9 @@ define(['exports'], (function (exports) { 'use strict';
3619
3622
  get onDidPopoutGroupPositionChange() {
3620
3623
  return this.component.onDidPopoutGroupPositionChange;
3621
3624
  }
3625
+ get onDidOpenPopoutWindowFail() {
3626
+ return this.component.onDidOpenPopoutWindowFail;
3627
+ }
3622
3628
  /**
3623
3629
  * All panel objects.
3624
3630
  */
@@ -8221,9 +8227,11 @@ define(['exports'], (function (exports) { 'use strict';
8221
8227
  this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
8222
8228
  this._onDidPopoutGroupPositionChange = new Emitter();
8223
8229
  this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8230
+ this._onDidOpenPopoutWindowFail = new Emitter();
8231
+ this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
8224
8232
  this._onDidLayoutFromJSON = new Emitter();
8225
8233
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
8226
- this._onDidActivePanelChange = new Emitter();
8234
+ this._onDidActivePanelChange = new Emitter({ replay: true });
8227
8235
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
8228
8236
  this._onDidMovePanel = new Emitter();
8229
8237
  this.onDidMovePanel = this._onDidMovePanel.event;
@@ -8285,7 +8293,7 @@ define(['exports'], (function (exports) { 'use strict';
8285
8293
  if (options.debug) {
8286
8294
  this.addDisposables(new StrictEventsSequencing(this));
8287
8295
  }
8288
- 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(() => {
8289
8297
  this.updateWatermark();
8290
8298
  }), this.onDidAdd((event) => {
8291
8299
  if (!this._moving) {
@@ -8431,13 +8439,6 @@ define(['exports'], (function (exports) { 'use strict';
8431
8439
  if (_window.isDisposed) {
8432
8440
  return false;
8433
8441
  }
8434
- if (popoutContainer === null) {
8435
- popoutWindowDisposable.dispose();
8436
- return false;
8437
- }
8438
- const gready = document.createElement('div');
8439
- gready.className = 'dv-overlay-render-container';
8440
- const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8441
8442
  const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
8442
8443
  ? options.referenceGroup
8443
8444
  : itemToPopout instanceof DockviewPanel
@@ -8445,7 +8446,7 @@ define(['exports'], (function (exports) { 'use strict';
8445
8446
  : itemToPopout;
8446
8447
  const referenceLocation = itemToPopout.api.location.type;
8447
8448
  /**
8448
- * 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
8449
8450
  * of this case is when being called from the `fromJSON(...)` method
8450
8451
  */
8451
8452
  const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
@@ -8458,8 +8459,28 @@ define(['exports'], (function (exports) { 'use strict';
8458
8459
  }
8459
8460
  else {
8460
8461
  group = this.createGroup({ id: groupId });
8461
- this._onDidAddGroup.fire(group);
8462
+ if (popoutContainer) {
8463
+ this._onDidAddGroup.fire(group);
8464
+ }
8462
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);
8463
8484
  group.model.renderContainer = overlayRenderContainer;
8464
8485
  group.layout(_window.window.innerWidth, _window.window.innerHeight);
8465
8486
  let floatingBox;
@@ -8616,7 +8637,7 @@ define(['exports'], (function (exports) { 'use strict';
8616
8637
  return true;
8617
8638
  })
8618
8639
  .catch((err) => {
8619
- console.error('dockview: failed to create popout window', err);
8640
+ console.error('dockview: failed to create popout.', err);
8620
8641
  return false;
8621
8642
  });
8622
8643
  }