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
  */
@@ -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
  }
@@ -3987,9 +3990,9 @@
3987
3990
  onDragOver: (e) => {
3988
3991
  var _a, _b, _c, _d, _e, _f, _g;
3989
3992
  Droptarget.ACTUAL_TARGET = this;
3990
- const overrideTraget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
3993
+ const overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
3991
3994
  if (this._acceptedTargetZonesSet.size === 0) {
3992
- if (overrideTraget) {
3995
+ if (overrideTarget) {
3993
3996
  return;
3994
3997
  }
3995
3998
  this.removeDropTarget();
@@ -4016,7 +4019,7 @@
4016
4019
  return;
4017
4020
  }
4018
4021
  if (!this.options.canDisplayOverlay(e, quadrant)) {
4019
- if (overrideTraget) {
4022
+ if (overrideTarget) {
4020
4023
  return;
4021
4024
  }
4022
4025
  this.removeDropTarget();
@@ -4036,7 +4039,7 @@
4036
4039
  return;
4037
4040
  }
4038
4041
  this.markAsUsed(e);
4039
- if (overrideTraget) ;
4042
+ if (overrideTarget) ;
4040
4043
  else if (!this.targetElement) {
4041
4044
  this.targetElement = document.createElement('div');
4042
4045
  this.targetElement.className = 'dv-drop-target-dropzone';
@@ -5145,7 +5148,7 @@
5145
5148
  this.accessor.doSetGroupActive(this.group);
5146
5149
  }));
5147
5150
  const handler = new GroupDragHandler(this._element, accessor, group);
5148
- this.dropTraget = new Droptarget(this._element, {
5151
+ this.dropTarget = new Droptarget(this._element, {
5149
5152
  acceptedTargetZones: ['center'],
5150
5153
  canDisplayOverlay: (event, position) => {
5151
5154
  const data = getPanelData();
@@ -5156,12 +5159,12 @@
5156
5159
  },
5157
5160
  getOverrideTarget: () => { var _a; return (_a = group.model.dropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
5158
5161
  });
5159
- this.onWillShowOverlay = this.dropTraget.onWillShowOverlay;
5162
+ this.onWillShowOverlay = this.dropTarget.onWillShowOverlay;
5160
5163
  this.addDisposables(handler, handler.onDragStart((event) => {
5161
5164
  this._onDragStart.fire(event);
5162
- }), this.dropTraget.onDrop((event) => {
5165
+ }), this.dropTarget.onDrop((event) => {
5163
5166
  this._onDrop.fire(event);
5164
- }), this.dropTraget);
5167
+ }), this.dropTarget);
5165
5168
  }
5166
5169
  }
5167
5170
 
@@ -8234,7 +8237,7 @@
8234
8237
  this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8235
8238
  this._onDidLayoutFromJSON = new Emitter();
8236
8239
  this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
8237
- this._onDidActivePanelChange = new Emitter();
8240
+ this._onDidActivePanelChange = new Emitter({ replay: true });
8238
8241
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
8239
8242
  this._onDidMovePanel = new Emitter();
8240
8243
  this.onDidMovePanel = this._onDidMovePanel.event;
@@ -8449,9 +8452,11 @@
8449
8452
  const gready = document.createElement('div');
8450
8453
  gready.className = 'dv-overlay-render-container';
8451
8454
  const overlayRenderContainer = new OverlayRenderContainer(gready, this);
8452
- const referenceGroup = itemToPopout instanceof DockviewPanel
8453
- ? itemToPopout.group
8454
- : itemToPopout;
8455
+ const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
8456
+ ? options.referenceGroup
8457
+ : itemToPopout instanceof DockviewPanel
8458
+ ? itemToPopout.group
8459
+ : itemToPopout;
8455
8460
  const referenceLocation = itemToPopout.api.location.type;
8456
8461
  /**
8457
8462
  * The group that is being added doesn't already exist within the DOM, the most likely occurance
@@ -8939,7 +8944,7 @@
8939
8944
  return result;
8940
8945
  }
8941
8946
  fromJSON(data) {
8942
- var _a, _b, _c;
8947
+ var _a, _b;
8943
8948
  this.clear();
8944
8949
  if (typeof data !== 'object' || data === null) {
8945
8950
  throw new Error('serialized layout must be a non-null object');
@@ -9011,12 +9016,11 @@
9011
9016
  for (const serializedPopoutGroup of serializedPopoutGroups) {
9012
9017
  const { data, position, gridReferenceGroup, url } = serializedPopoutGroup;
9013
9018
  const group = createGroupFromSerializedState(data);
9014
- this.addPopoutGroup((_c = (gridReferenceGroup
9015
- ? this.getPanel(gridReferenceGroup)
9016
- : undefined)) !== null && _c !== void 0 ? _c : group, {
9019
+ this.addPopoutGroup(group, {
9017
9020
  position: position !== null && position !== void 0 ? position : undefined,
9018
- overridePopoutGroup: gridReferenceGroup
9019
- ? group
9021
+ overridePopoutGroup: gridReferenceGroup ? group : undefined,
9022
+ referenceGroup: gridReferenceGroup
9023
+ ? this.getPanel(gridReferenceGroup)
9020
9024
  : undefined,
9021
9025
  popoutUrl: url,
9022
9026
  });