dockview-react 4.2.0 → 4.2.3

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.0
3
+ * @version 4.2.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -5457,7 +5457,7 @@
5457
5457
  this._element.appendChild(this.leftActionsContainer);
5458
5458
  this._element.appendChild(this.voidContainer.element);
5459
5459
  this._element.appendChild(this.rightActionsContainer);
5460
- this.addDisposables(accessor.onDidOptionsChange(() => {
5460
+ this.addDisposables(this.tabs.onDrop((e) => this._onDrop.fire(e)), this.tabs.onWillShowOverlay((e) => this._onWillShowOverlay.fire(e)), accessor.onDidOptionsChange(() => {
5461
5461
  this.tabs.showTabsOverflowControl =
5462
5462
  !accessor.options.disableTabsOverflowList;
5463
5463
  }), this.tabs.onOverflowTabsChange((event) => {
@@ -8175,13 +8175,48 @@
8175
8175
  this._onDidActiveGroupChange = new Emitter();
8176
8176
  this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
8177
8177
  this._moving = false;
8178
+ this._options = options;
8178
8179
  this.popupService = new PopupService(this.element);
8179
- this.updateDropTargetModel(options);
8180
8180
  this._themeClassnames = new Classnames(this.element);
8181
+ this._api = new DockviewApi(this);
8181
8182
  this.rootDropTargetContainer = new DropTargetAnchorContainer(this.element, { disabled: true });
8182
8183
  this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
8184
+ this._rootDropTarget = new Droptarget(this.element, {
8185
+ className: 'dv-drop-target-edge',
8186
+ canDisplayOverlay: (event, position) => {
8187
+ const data = getPanelData();
8188
+ if (data) {
8189
+ if (data.viewId !== this.id) {
8190
+ return false;
8191
+ }
8192
+ if (position === 'center') {
8193
+ // center drop target is only allowed if there are no panels in the grid
8194
+ // floating panels are allowed
8195
+ return this.gridview.length === 0;
8196
+ }
8197
+ return true;
8198
+ }
8199
+ if (position === 'center' && this.gridview.length !== 0) {
8200
+ /**
8201
+ * for external events only show the four-corner drag overlays, disable
8202
+ * the center position so that external drag events can fall through to the group
8203
+ * and panel drop target handlers
8204
+ */
8205
+ return false;
8206
+ }
8207
+ const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8208
+ this._onUnhandledDragOverEvent.fire(firedEvent);
8209
+ return firedEvent.isAccepted;
8210
+ },
8211
+ acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8212
+ overlayModel: (_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8213
+ getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8214
+ });
8215
+ this.updateDropTargetModel(options);
8183
8216
  toggleClass(this.gridview.element, 'dv-dockview', true);
8184
8217
  toggleClass(this.element, 'dv-debug', !!options.debug);
8218
+ this.updateTheme();
8219
+ this.updateWatermark();
8185
8220
  if (options.debug) {
8186
8221
  this.addDisposables(new StrictEventsSequencing(this));
8187
8222
  }
@@ -8217,41 +8252,7 @@
8217
8252
  for (const group of [...this._popoutGroups]) {
8218
8253
  group.disposable.dispose();
8219
8254
  }
8220
- }));
8221
- this._options = options;
8222
- this.updateTheme();
8223
- this._rootDropTarget = new Droptarget(this.element, {
8224
- className: 'dv-drop-target-edge',
8225
- canDisplayOverlay: (event, position) => {
8226
- const data = getPanelData();
8227
- if (data) {
8228
- if (data.viewId !== this.id) {
8229
- return false;
8230
- }
8231
- if (position === 'center') {
8232
- // center drop target is only allowed if there are no panels in the grid
8233
- // floating panels are allowed
8234
- return this.gridview.length === 0;
8235
- }
8236
- return true;
8237
- }
8238
- if (position === 'center' && this.gridview.length !== 0) {
8239
- /**
8240
- * for external events only show the four-corner drag overlays, disable
8241
- * the center position so that external drag events can fall through to the group
8242
- * and panel drop target handlers
8243
- */
8244
- return false;
8245
- }
8246
- const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
8247
- this._onUnhandledDragOverEvent.fire(firedEvent);
8248
- return firedEvent.isAccepted;
8249
- },
8250
- acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
8251
- overlayModel: (_c = this.options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
8252
- getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
8253
- });
8254
- this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8255
+ }), this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
8255
8256
  if (this.gridview.length > 0 && event.position === 'center') {
8256
8257
  // option only available when no panels in primary grid
8257
8258
  return;
@@ -8302,8 +8303,6 @@
8302
8303
  }));
8303
8304
  }
8304
8305
  }), this._rootDropTarget);
8305
- this._api = new DockviewApi(this);
8306
- this.updateWatermark();
8307
8306
  }
8308
8307
  setVisible(panel, visible) {
8309
8308
  switch (panel.api.location.type) {
@@ -11116,6 +11115,7 @@
11116
11115
  }
11117
11116
  dockviewRef.current = api;
11118
11117
  return () => {
11118
+ dockviewRef.current = undefined;
11119
11119
  api.dispose();
11120
11120
  };
11121
11121
  }, []);
@@ -11351,6 +11351,7 @@
11351
11351
  }
11352
11352
  splitviewRef.current = api;
11353
11353
  return () => {
11354
+ splitviewRef.current = undefined;
11354
11355
  api.dispose();
11355
11356
  };
11356
11357
  }, []);
@@ -11434,6 +11435,7 @@
11434
11435
  }
11435
11436
  gridviewRef.current = api;
11436
11437
  return () => {
11438
+ gridviewRef.current = undefined;
11437
11439
  api.dispose();
11438
11440
  };
11439
11441
  }, []);
@@ -11539,6 +11541,7 @@
11539
11541
  }
11540
11542
  paneviewRef.current = api;
11541
11543
  return () => {
11544
+ paneviewRef.current = undefined;
11542
11545
  api.dispose();
11543
11546
  };
11544
11547
  }, []);