dockview-core 1.10.1 → 1.10.2

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 (63) hide show
  1. package/dist/cjs/api/dockviewGroupPanelApi.js +1 -1
  2. package/dist/cjs/api/dockviewPanelApi.d.ts +4 -1
  3. package/dist/cjs/api/dockviewPanelApi.js +10 -2
  4. package/dist/cjs/api/gridviewPanelApi.d.ts +1 -1
  5. package/dist/cjs/api/gridviewPanelApi.js +2 -2
  6. package/dist/cjs/api/panelApi.d.ts +8 -3
  7. package/dist/cjs/api/panelApi.js +13 -6
  8. package/dist/cjs/api/paneviewPanelApi.d.ts +1 -1
  9. package/dist/cjs/api/paneviewPanelApi.js +2 -2
  10. package/dist/cjs/api/splitviewPanelApi.d.ts +1 -1
  11. package/dist/cjs/api/splitviewPanelApi.js +2 -2
  12. package/dist/cjs/dockview/deserializer.js +1 -1
  13. package/dist/cjs/dockview/dockviewComponent.js +3 -1
  14. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +7 -1
  15. package/dist/cjs/dockview/dockviewGroupPanelModel.js +16 -0
  16. package/dist/cjs/dockview/dockviewPanel.d.ts +1 -1
  17. package/dist/cjs/dockview/dockviewPanel.js +2 -2
  18. package/dist/cjs/gridview/gridviewPanel.js +1 -1
  19. package/dist/cjs/paneview/paneviewPanel.js +1 -1
  20. package/dist/cjs/splitview/splitviewPanel.js +1 -1
  21. package/dist/dockview-core.amd.js +46 -23
  22. package/dist/dockview-core.amd.js.map +1 -1
  23. package/dist/dockview-core.amd.min.js +2 -2
  24. package/dist/dockview-core.amd.min.js.map +1 -1
  25. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  26. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  27. package/dist/dockview-core.amd.noStyle.js +46 -23
  28. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  29. package/dist/dockview-core.cjs.js +46 -23
  30. package/dist/dockview-core.cjs.js.map +1 -1
  31. package/dist/dockview-core.esm.js +46 -23
  32. package/dist/dockview-core.esm.js.map +1 -1
  33. package/dist/dockview-core.esm.min.js +2 -2
  34. package/dist/dockview-core.esm.min.js.map +1 -1
  35. package/dist/dockview-core.js +46 -23
  36. package/dist/dockview-core.js.map +1 -1
  37. package/dist/dockview-core.min.js +2 -2
  38. package/dist/dockview-core.min.js.map +1 -1
  39. package/dist/dockview-core.min.noStyle.js +2 -2
  40. package/dist/dockview-core.min.noStyle.js.map +1 -1
  41. package/dist/dockview-core.noStyle.js +46 -23
  42. package/dist/dockview-core.noStyle.js.map +1 -1
  43. package/dist/esm/api/dockviewGroupPanelApi.js +1 -1
  44. package/dist/esm/api/dockviewPanelApi.d.ts +4 -1
  45. package/dist/esm/api/dockviewPanelApi.js +6 -2
  46. package/dist/esm/api/gridviewPanelApi.d.ts +1 -1
  47. package/dist/esm/api/gridviewPanelApi.js +2 -2
  48. package/dist/esm/api/panelApi.d.ts +8 -3
  49. package/dist/esm/api/panelApi.js +12 -6
  50. package/dist/esm/api/paneviewPanelApi.d.ts +1 -1
  51. package/dist/esm/api/paneviewPanelApi.js +2 -2
  52. package/dist/esm/api/splitviewPanelApi.d.ts +1 -1
  53. package/dist/esm/api/splitviewPanelApi.js +2 -2
  54. package/dist/esm/dockview/deserializer.js +1 -1
  55. package/dist/esm/dockview/dockviewComponent.js +3 -1
  56. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +7 -1
  57. package/dist/esm/dockview/dockviewGroupPanelModel.js +11 -0
  58. package/dist/esm/dockview/dockviewPanel.d.ts +1 -1
  59. package/dist/esm/dockview/dockviewPanel.js +2 -2
  60. package/dist/esm/gridview/gridviewPanel.js +1 -1
  61. package/dist/esm/paneview/paneviewPanel.js +1 -1
  62. package/dist/esm/splitview/splitviewPanel.js +1 -1
  63. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 1.10.1
3
+ * @version 1.10.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -4269,6 +4269,7 @@
4269
4269
  this._width = 0;
4270
4270
  this._height = 0;
4271
4271
  this._panels = [];
4272
+ this._panelDisposables = new Map();
4272
4273
  this._onMove = new Emitter();
4273
4274
  this.onMove = this._onMove.event;
4274
4275
  this._onDidDrop = new Emitter();
@@ -4283,6 +4284,10 @@
4283
4284
  this.onGroupDragStart = this._onGroupDragStart.event;
4284
4285
  this._onDidAddPanel = new Emitter();
4285
4286
  this.onDidAddPanel = this._onDidAddPanel.event;
4287
+ this._onDidPanelTitleChange = new Emitter();
4288
+ this.onDidPanelTitleChange = this._onDidPanelTitleChange.event;
4289
+ this._onDidPanelParametersChange = new Emitter();
4290
+ this.onDidPanelParametersChange = this._onDidPanelParametersChange.event;
4286
4291
  this._onDidRemovePanel = new Emitter();
4287
4292
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4288
4293
  this._onDidActivePanelChange = new Emitter();
@@ -4571,6 +4576,11 @@
4571
4576
  if (this.mostRecentlyUsed.includes(panel)) {
4572
4577
  this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(panel), 1);
4573
4578
  }
4579
+ const disposable = this._panelDisposables.get(panel.id);
4580
+ if (disposable) {
4581
+ disposable.dispose();
4582
+ this._panelDisposables.delete(panel.id);
4583
+ }
4574
4584
  this._onDidRemovePanel.fire({ panel });
4575
4585
  }
4576
4586
  doAddPanel(panel, index = this.panels.length, options = { skipSetActive: false }) {
@@ -4588,6 +4598,7 @@
4588
4598
  }
4589
4599
  this.updateMru(panel);
4590
4600
  this.panels.splice(index, 0, panel);
4601
+ this._panelDisposables.set(panel.id, new CompositeDisposable(panel.api.onDidTitleChange((event) => this._onDidPanelTitleChange.fire(event)), panel.api.onDidParametersChange((event) => this._onDidPanelParametersChange.fire(event))));
4591
4602
  this._onDidAddPanel.fire({ panel });
4592
4603
  }
4593
4604
  doSetActivePanel(panel) {
@@ -5011,14 +5022,16 @@
5011
5022
  get height() {
5012
5023
  return this._height;
5013
5024
  }
5014
- constructor(id) {
5025
+ constructor(id, component) {
5015
5026
  super();
5016
5027
  this.id = id;
5028
+ this.component = component;
5017
5029
  this._isFocused = false;
5018
5030
  this._isActive = false;
5019
5031
  this._isVisible = true;
5020
5032
  this._width = 0;
5021
5033
  this._height = 0;
5034
+ this._parameters = {};
5022
5035
  this.panelUpdatesDisposable = new MutableDisposable();
5023
5036
  this._onDidDimensionChange = new Emitter();
5024
5037
  this.onDidDimensionsChange = this._onDidDimensionChange.event;
@@ -5036,8 +5049,8 @@
5036
5049
  this.onDidActiveChange = this._onDidActiveChange.event;
5037
5050
  this._onActiveChange = new Emitter();
5038
5051
  this.onActiveChange = this._onActiveChange.event;
5039
- this._onUpdateParameters = new Emitter();
5040
- this.onUpdateParameters = this._onUpdateParameters.event;
5052
+ this._onDidParametersChange = new Emitter();
5053
+ this.onDidParametersChange = this._onDidParametersChange.event;
5041
5054
  this.addDisposables(this.onDidFocusChange((event) => {
5042
5055
  this._isFocused = event.isFocused;
5043
5056
  }), this.onDidActiveChange((event) => {
@@ -5047,10 +5060,14 @@
5047
5060
  }), this.onDidDimensionsChange((event) => {
5048
5061
  this._width = event.width;
5049
5062
  this._height = event.height;
5050
- }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onUpdateParameters, this._onWillFocus, this._onWillVisibilityChange, this._onUpdateParameters);
5063
+ }), this.panelUpdatesDisposable, this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onWillFocus, this._onActiveChange, this._onWillFocus, this._onWillVisibilityChange, this._onDidParametersChange);
5064
+ }
5065
+ getParameters() {
5066
+ return this._parameters;
5051
5067
  }
5052
5068
  initialize(panel) {
5053
- this.panelUpdatesDisposable.value = this._onUpdateParameters.event((parameters) => {
5069
+ this.panelUpdatesDisposable.value = this._onDidParametersChange.event((parameters) => {
5070
+ this._parameters = parameters;
5054
5071
  panel.update({
5055
5072
  params: parameters,
5056
5073
  });
@@ -5063,14 +5080,14 @@
5063
5080
  this._onActiveChange.fire();
5064
5081
  }
5065
5082
  updateParameters(parameters) {
5066
- this._onUpdateParameters.fire(parameters);
5083
+ this._onDidParametersChange.fire(parameters);
5067
5084
  }
5068
5085
  }
5069
5086
 
5070
5087
  class SplitviewPanelApiImpl extends PanelApiImpl {
5071
5088
  //
5072
- constructor(id) {
5073
- super(id);
5089
+ constructor(id, component) {
5090
+ super(id, component);
5074
5091
  this._onDidConstraintsChangeInternal = new Emitter();
5075
5092
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5076
5093
  //
@@ -5095,8 +5112,8 @@
5095
5112
  set pane(pane) {
5096
5113
  this._pane = pane;
5097
5114
  }
5098
- constructor(id) {
5099
- super(id);
5115
+ constructor(id, component) {
5116
+ super(id, component);
5100
5117
  this._onDidExpansionChange = new Emitter({
5101
5118
  replay: true,
5102
5119
  });
@@ -5255,7 +5272,7 @@
5255
5272
  this.header.style.display = value ? '' : 'none';
5256
5273
  }
5257
5274
  constructor(id, component, headerComponent, orientation, isExpanded, isHeaderVisible) {
5258
- super(id, component, new PaneviewPanelApiImpl(id));
5275
+ super(id, component, new PaneviewPanelApiImpl(id, component));
5259
5276
  this.headerComponent = headerComponent;
5260
5277
  this._onDidChangeExpansionState = new Emitter({ replay: true });
5261
5278
  this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
@@ -5486,8 +5503,8 @@
5486
5503
  }
5487
5504
 
5488
5505
  class GridviewPanelApiImpl extends PanelApiImpl {
5489
- constructor(id, panel) {
5490
- super(id);
5506
+ constructor(id, component, panel) {
5507
+ super(id, component);
5491
5508
  this._onDidConstraintsChangeInternal = new Emitter();
5492
5509
  this.onDidConstraintsChangeInternal = this._onDidConstraintsChangeInternal.event;
5493
5510
  this._onDidConstraintsChange = new Emitter();
@@ -5558,7 +5575,7 @@
5558
5575
  return this.api.isActive;
5559
5576
  }
5560
5577
  constructor(id, component, options, api) {
5561
- super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id));
5578
+ super(id, component, api !== null && api !== void 0 ? api : new GridviewPanelApiImpl(id, component));
5562
5579
  this._evaluatedMinimumWidth = 0;
5563
5580
  this._evaluatedMaximumWidth = Number.MAX_SAFE_INTEGER;
5564
5581
  this._evaluatedMinimumHeight = 0;
@@ -5666,7 +5683,7 @@
5666
5683
  return this._group.model.location;
5667
5684
  }
5668
5685
  constructor(id, accessor) {
5669
- super(id);
5686
+ super(id, '__dockviewgroup__');
5670
5687
  this.accessor = accessor;
5671
5688
  this._onDidLocationChange = new Emitter();
5672
5689
  this.onDidLocationChange = this._onDidLocationChange.event;
@@ -5840,8 +5857,11 @@
5840
5857
  get group() {
5841
5858
  return this._group;
5842
5859
  }
5843
- constructor(panel, group, accessor) {
5844
- super(panel.id);
5860
+ get tabComponent() {
5861
+ return this._tabComponent;
5862
+ }
5863
+ constructor(panel, group, accessor, component, tabComponent) {
5864
+ super(panel.id, component);
5845
5865
  this.panel = panel;
5846
5866
  this.accessor = accessor;
5847
5867
  this._onDidTitleChange = new Emitter();
@@ -5855,6 +5875,7 @@
5855
5875
  this._onDidLocationChange = new Emitter();
5856
5876
  this.onDidLocationChange = this._onDidLocationChange.event;
5857
5877
  this.groupEventsDisposable = new MutableDisposable();
5878
+ this._tabComponent = tabComponent;
5858
5879
  this.initialize(panel);
5859
5880
  this._group = group;
5860
5881
  this.setupGroupEventListeners();
@@ -5937,7 +5958,7 @@
5937
5958
  var _a;
5938
5959
  return (_a = this._renderer) !== null && _a !== void 0 ? _a : this.accessor.renderer;
5939
5960
  }
5940
- constructor(id, accessor, containerApi, group, view, options) {
5961
+ constructor(id, component, tabComponent, accessor, containerApi, group, view, options) {
5941
5962
  super();
5942
5963
  this.id = id;
5943
5964
  this.accessor = accessor;
@@ -5945,7 +5966,7 @@
5945
5966
  this.view = view;
5946
5967
  this._renderer = options.renderer;
5947
5968
  this._group = group;
5948
- this.api = new DockviewPanelApiImpl(this, this._group, accessor);
5969
+ this.api = new DockviewPanelApiImpl(this, this._group, accessor, component, tabComponent);
5949
5970
  this.addDisposables(this.api.onActiveChange(() => {
5950
5971
  accessor.setActivePanel(this);
5951
5972
  }), this.api.onDidSizeChange((event) => {
@@ -6240,7 +6261,7 @@
6240
6261
  ? (_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id
6241
6262
  : panelData.tabComponent;
6242
6263
  const view = new DockviewPanelModel(this.accessor, panelId, contentComponent, tabComponent);
6243
- const panel = new DockviewPanel(panelId, this.accessor, new DockviewApi(this.accessor), group, view, {
6264
+ const panel = new DockviewPanel(panelId, contentComponent, tabComponent, this.accessor, new DockviewApi(this.accessor), group, view, {
6244
6265
  renderer: panelData.renderer,
6245
6266
  });
6246
6267
  panel.init({
@@ -8250,6 +8271,8 @@
8250
8271
  if (this._onDidActivePanelChange.value !== event.panel) {
8251
8272
  this._onDidActivePanelChange.fire(event.panel);
8252
8273
  }
8274
+ }), exports.DockviewEvent.any(view.model.onDidPanelTitleChange, view.model.onDidPanelParametersChange)(() => {
8275
+ this._bufferOnDidLayoutChange.fire();
8253
8276
  }));
8254
8277
  this._groups.set(view.id, { value: view, disposable });
8255
8278
  }
@@ -8262,7 +8285,7 @@
8262
8285
  const contentComponent = options.component;
8263
8286
  const tabComponent = (_a = options.tabComponent) !== null && _a !== void 0 ? _a : this.options.defaultTabComponent;
8264
8287
  const view = new DockviewPanelModel(this, options.id, contentComponent, tabComponent);
8265
- const panel = new DockviewPanel(options.id, this, this._api, group, view, { renderer: options.renderer });
8288
+ const panel = new DockviewPanel(options.id, contentComponent, tabComponent, this, this._api, group, view, { renderer: options.renderer });
8266
8289
  panel.init({
8267
8290
  title: (_b = options.title) !== null && _b !== void 0 ? _b : options.id,
8268
8291
  params: (_c = options === null || options === void 0 ? void 0 : options.params) !== null && _c !== void 0 ? _c : {},
@@ -9177,7 +9200,7 @@
9177
9200
  return this._snap;
9178
9201
  }
9179
9202
  constructor(id, componentName) {
9180
- super(id, componentName, new SplitviewPanelApiImpl(id));
9203
+ super(id, componentName, new SplitviewPanelApiImpl(id, componentName));
9181
9204
  this._evaluatedMinimumSize = 0;
9182
9205
  this._evaluatedMaximumSize = Number.POSITIVE_INFINITY;
9183
9206
  this._minimumSize = 0;