dockview-react 4.2.5 → 4.3.1

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-react
3
- * @version 4.2.5
3
+ * @version 4.3.1
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -191,7 +191,10 @@
191
191
  return this._event;
192
192
  }
193
193
  fire(e) {
194
- this._last = e;
194
+ var _a;
195
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) {
196
+ this._last = e;
197
+ }
195
198
  for (const listener of this._listeners) {
196
199
  listener.callback(e);
197
200
  }
@@ -3957,9 +3960,9 @@
3957
3960
  onDragOver: (e) => {
3958
3961
  var _a, _b, _c, _d, _e, _f, _g;
3959
3962
  Droptarget.ACTUAL_TARGET = this;
3960
- const overrideTraget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
3963
+ const overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
3961
3964
  if (this._acceptedTargetZonesSet.size === 0) {
3962
- if (overrideTraget) {
3965
+ if (overrideTarget) {
3963
3966
  return;
3964
3967
  }
3965
3968
  this.removeDropTarget();
@@ -3986,7 +3989,7 @@
3986
3989
  return;
3987
3990
  }
3988
3991
  if (!this.options.canDisplayOverlay(e, quadrant)) {
3989
- if (overrideTraget) {
3992
+ if (overrideTarget) {
3990
3993
  return;
3991
3994
  }
3992
3995
  this.removeDropTarget();
@@ -4006,7 +4009,7 @@
4006
4009
  return;
4007
4010
  }
4008
4011
  this.markAsUsed(e);
4009
- if (overrideTraget) ;
4012
+ if (overrideTarget) ;
4010
4013
  else if (!this.targetElement) {
4011
4014
  this.targetElement = document.createElement('div');
4012
4015
  this.targetElement.className = 'dv-drop-target-dropzone';
@@ -5115,7 +5118,7 @@
5115
5118
  this.accessor.doSetGroupActive(this.group);
5116
5119
  }));
5117
5120
  const handler = new GroupDragHandler(this._element, accessor, group);
5118
- this.dropTraget = new Droptarget(this._element, {
5121
+ this.dropTarget = new Droptarget(this._element, {
5119
5122
  acceptedTargetZones: ['center'],
5120
5123
  canDisplayOverlay: (event, position) => {
5121
5124
  const data = getPanelData();
@@ -5126,12 +5129,12 @@
5126
5129
  },
5127
5130
  getOverrideTarget: () => { var _a; return (_a = group.model.dropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
5128
5131
  });
5129
- this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
5132
+ this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
5130
5133
  this.addDisposables(handler, handler.onDragStart((event) => {
5131
5134
  this._onDragStart.fire(event);
5132
- }), this.dropTraget.onDrop((event) => {
5135
+ }), this.dropTarget.onDrop((event) => {
5133
5136
  this._onDrop.fire(event);
5134
- }), this.dropTraget);
5137
+ }), this.dropTarget);
5135
5138
  }
5136
5139
  }
5137
5140
 
@@ -8204,7 +8207,7 @@
8204
8207
  this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8205
8208
  this._onDidLayoutFromJSON = new Emitter();
8206
8209
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
8207
- this._onDidActivePanelChange = new Emitter();
8210
+ this._onDidActivePanelChange = new Emitter({ replay: true });
8208
8211
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
8209
8212
  this._onDidMovePanel = new Emitter();
8210
8213
  this.onDidMovePanel = this._onDidMovePanel.event;
@@ -8419,9 +8422,11 @@
8419
8422
  const gready = document.createElement('div');
8420
8423
  gready.className = 'dv-overlay-render-container';
8421
8424
  const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8422
- const referenceGroup = itemToPopout instanceof DockviewPanel
8423
- ? itemToPopout.group
8424
- : itemToPopout;
8425
+ const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
8426
+ ? options.referenceGroup
8427
+ : itemToPopout instanceof DockviewPanel
8428
+ ? itemToPopout.group
8429
+ : itemToPopout;
8425
8430
  const referenceLocation = itemToPopout.api.location.type;
8426
8431
  /**
8427
8432
  * The group that is being added doesn't already exist within the DOM, the most likely occurance
@@ -8909,7 +8914,7 @@
8909
8914
  return result;
8910
8915
  }
8911
8916
  fromJSON(data) {
8912
- var _a, _b, _c;
8917
+ var _a, _b;
8913
8918
  this.clear();
8914
8919
  if (typeof data !== 'object' || data === null) {
8915
8920
  throw new Error('serialized layout must be a non-null object');
@@ -8981,12 +8986,11 @@
8981
8986
  for (const serializedPopoutGroup of serializedPopoutGroups) {
8982
8987
  const { data, position, gridReferenceGroup, url } = serializedPopoutGroup;
8983
8988
  const group = createGroupFromSerializedState(data);
8984
- this.addPopoutGroup((_c = (gridReferenceGroup
8985
- ? this.getPanel(gridReferenceGroup)
8986
- : undefined)) !== null && _c !== void 0 ? _c : group, {
8989
+ this.addPopoutGroup(group, {
8987
8990
  position: position !== null && position !== void 0 ? position : undefined,
8988
- overridePopoutGroup: gridReferenceGroup
8989
- ? group
8991
+ overridePopoutGroup: gridReferenceGroup ? group : undefined,
8992
+ referenceGroup: gridReferenceGroup
8993
+ ? this.getPanel(gridReferenceGroup)
8990
8994
  : undefined,
8991
8995
  popoutUrl: url,
8992
8996
  });