dockview 1.11.0 → 1.12.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
3
- * @version 1.11.0
3
+ * @version 1.12.0
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -3576,7 +3576,7 @@ class ContentContainer extends CompositeDisposable {
3576
3576
  this.panel = panel;
3577
3577
  let container;
3578
3578
  switch (panel.api.renderer) {
3579
- case 'onlyWhenVisibile':
3579
+ case 'onlyWhenVisible':
3580
3580
  this.group.renderContainer.detatch(panel);
3581
3581
  if (this.panel) {
3582
3582
  if (doRender) {
@@ -3622,7 +3622,7 @@ class ContentContainer extends CompositeDisposable {
3622
3622
  closePanel() {
3623
3623
  var _a;
3624
3624
  if (this.panel) {
3625
- if (this.panel.api.renderer === 'onlyWhenVisibile') {
3625
+ if (this.panel.api.renderer === 'onlyWhenVisible') {
3626
3626
  (_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
3627
3627
  }
3628
3628
  }
@@ -4011,6 +4011,10 @@ class TabsContainer extends CompositeDisposable {
4011
4011
  }), this.voidContainer.onWillShowOverlay((event) => {
4012
4012
  this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
4013
4013
  kind: 'header_space',
4014
+ panel: this.group.activePanel,
4015
+ api: this.accessor.api,
4016
+ group: this.group,
4017
+ getData: getPanelData,
4014
4018
  }));
4015
4019
  }), addDisposableListener(this.voidContainer.element, 'mousedown', (event) => {
4016
4020
  const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
@@ -4108,7 +4112,13 @@ class TabsContainer extends CompositeDisposable {
4108
4112
  index: this.tabs.findIndex((x) => x.value === tab),
4109
4113
  });
4110
4114
  }), tab.onWillShowOverlay((event) => {
4111
- this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, { kind: 'tab' }));
4115
+ this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
4116
+ kind: 'tab',
4117
+ panel: this.group.activePanel,
4118
+ api: this.accessor.api,
4119
+ group: this.group,
4120
+ getData: getPanelData,
4121
+ }));
4112
4122
  }));
4113
4123
  const value = { value: tab, disposable };
4114
4124
  this.addTab(value, index);
@@ -4161,7 +4171,7 @@ class DockviewWillDropEvent extends DockviewDidDropEvent {
4161
4171
  }
4162
4172
  class WillShowOverlayLocationEvent {
4163
4173
  get kind() {
4164
- return this._kind;
4174
+ return this.options.kind;
4165
4175
  }
4166
4176
  get nativeEvent() {
4167
4177
  return this.event.nativeEvent;
@@ -4172,12 +4182,24 @@ class WillShowOverlayLocationEvent {
4172
4182
  get defaultPrevented() {
4173
4183
  return this.event.defaultPrevented;
4174
4184
  }
4185
+ get panel() {
4186
+ return this.options.panel;
4187
+ }
4188
+ get api() {
4189
+ return this.options.api;
4190
+ }
4191
+ get group() {
4192
+ return this.options.group;
4193
+ }
4175
4194
  preventDefault() {
4176
4195
  this.event.preventDefault();
4177
4196
  }
4197
+ getData() {
4198
+ return this.options.getData();
4199
+ }
4178
4200
  constructor(event, options) {
4179
4201
  this.event = event;
4180
- this._kind = options.kind;
4202
+ this.options = options;
4181
4203
  }
4182
4204
  }
4183
4205
  class DockviewGroupPanelModel extends CompositeDisposable {
@@ -4316,6 +4338,10 @@ class DockviewGroupPanelModel extends CompositeDisposable {
4316
4338
  }), this.contentContainer.dropTarget.onWillShowOverlay((event) => {
4317
4339
  this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
4318
4340
  kind: 'content',
4341
+ panel: this.activePanel,
4342
+ api: this._api,
4343
+ group: this.groupPanel,
4344
+ getData: getPanelData,
4319
4345
  }));
4320
4346
  }), this._onMove, this._onDidChange, this._onDidDrop, this._onWillDrop, this._onDidAddPanel, this._onDidRemovePanel, this._onDidActivePanelChange);
4321
4347
  }
@@ -6961,7 +6987,10 @@ class DockviewComponent extends BaseGrid {
6961
6987
  }
6962
6988
  get renderer() {
6963
6989
  var _a;
6964
- return (_a = this.options.defaultRenderer) !== null && _a !== void 0 ? _a : 'onlyWhenVisibile';
6990
+ return (_a = this.options.defaultRenderer) !== null && _a !== void 0 ? _a : 'onlyWhenVisible';
6991
+ }
6992
+ get api() {
6993
+ return this._api;
6965
6994
  }
6966
6995
  constructor(options) {
6967
6996
  var _a, _b;
@@ -7096,6 +7125,10 @@ class DockviewComponent extends BaseGrid {
7096
7125
  }
7097
7126
  this._onWillShowOverlay.fire(new WillShowOverlayLocationEvent(event, {
7098
7127
  kind: 'edge',
7128
+ panel: undefined,
7129
+ api: this._api,
7130
+ group: undefined,
7131
+ getData: getPanelData,
7099
7132
  }));
7100
7133
  }), this._rootDropTarget.onDrop((event) => {
7101
7134
  var _a;