dockview 1.7.1 → 1.7.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
3
- * @version 1.7.1
3
+ * @version 1.7.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -4613,7 +4613,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4613
4613
  this.id = id;
4614
4614
  this.containerApi = containerApi;
4615
4615
  this.view = view;
4616
- this._title = '';
4617
4616
  this._group = group;
4618
4617
  this.api = new DockviewPanelApiImpl(this, this._group);
4619
4618
  this.addDisposables(this.api.onActiveChange(() => {
@@ -4626,8 +4625,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4626
4625
  }
4627
4626
  init(params) {
4628
4627
  this._params = params.params;
4629
- this.setTitle(params.title);
4630
4628
  this.view.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
4629
+ this.setTitle(params.title);
4631
4630
  }
4632
4631
  focus() {
4633
4632
  this.api._onFocusEvent.fire();
@@ -4644,11 +4643,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4644
4643
  };
4645
4644
  }
4646
4645
  setTitle(title) {
4647
- var _a, _b;
4648
- const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
4646
+ const didTitleChange = title !== this.title;
4649
4647
  if (didTitleChange) {
4650
4648
  this._title = title;
4651
- (_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
4649
+ this.view.update({
4652
4650
  params: {
4653
4651
  params: this._params,
4654
4652
  title: this.title,
@@ -4658,14 +4656,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4658
4656
  }
4659
4657
  }
4660
4658
  update(event) {
4661
- var _a;
4662
4659
  const params = event.params;
4663
4660
  this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
4664
4661
  if (params.title !== this.title) {
4665
4662
  this._title = params.title;
4666
- this.api._onDidTitleChange.fire({ title: this.title });
4663
+ this.api._onDidTitleChange.fire({ title: params.title });
4667
4664
  }
4668
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
4665
+ this.view.update({
4669
4666
  params: {
4670
4667
  params: this._params,
4671
4668
  title: this.title,
@@ -4803,7 +4800,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4803
4800
  return this._tab;
4804
4801
  }
4805
4802
  constructor(accessor, id, contentComponent, tabComponent) {
4806
- var _a;
4807
4803
  this.accessor = accessor;
4808
4804
  this.id = id;
4809
4805
  this.contentComponent = contentComponent;
@@ -4811,8 +4807,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4811
4807
  this._group = null;
4812
4808
  this._isPanelVisible = null;
4813
4809
  this._content = this.createContentComponent(this.id, contentComponent);
4814
- this._tab =
4815
- (_a = this.createTabComponent(this.id, tabComponent)) !== null && _a !== void 0 ? _a : new DefaultTab();
4810
+ this._tab = this.createTabComponent(this.id, tabComponent);
4816
4811
  }
4817
4812
  init(params) {
4818
4813
  this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
@@ -4857,8 +4852,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4857
4852
  return createComponent(id, componentName, this.accessor.options.components || {}, this.accessor.options.frameworkComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
4858
4853
  }
4859
4854
  createTabComponent(id, componentName) {
4860
- var _a;
4861
- return createComponent(id, componentName, this.accessor.options.tabComponents || {}, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4855
+ var _a, _b;
4856
+ if (componentName) {
4857
+ return createComponent(id, componentName, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4858
+ }
4859
+ else if (this.accessor.options.defaultTabComponent) {
4860
+ return createComponent(id, this.accessor.options.defaultTabComponent, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_b = this.accessor.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4861
+ }
4862
+ else {
4863
+ return new DefaultTab();
4864
+ }
4862
4865
  }
4863
4866
  }
4864
4867
 
@@ -4867,7 +4870,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4867
4870
  this.layout = layout;
4868
4871
  }
4869
4872
  fromJSON(panelData, group) {
4870
- var _a, _b, _c;
4873
+ var _a;
4871
4874
  const panelId = panelData.id;
4872
4875
  const params = panelData.params;
4873
4876
  const title = panelData.title;
@@ -4878,15 +4881,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4878
4881
  const tabComponent = viewData
4879
4882
  ? (_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id
4880
4883
  : panelData.tabComponent;
4881
- if (tabComponent) {
4882
- createComponent(panelId, tabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4883
- }
4884
- else if (this.layout.options.defaultTabComponent) {
4885
- createComponent(panelId, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
4886
- }
4887
- else {
4888
- new DefaultTab();
4889
- }
4890
4884
  const view = new DockviewPanelModel(this.layout, panelId, contentComponent, tabComponent);
4891
4885
  const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group, view);
4892
4886
  panel.init({
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.7.1
3
+ * @version 1.7.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -4646,7 +4646,6 @@ class DockviewPanel extends CompositeDisposable {
4646
4646
  this.id = id;
4647
4647
  this.containerApi = containerApi;
4648
4648
  this.view = view;
4649
- this._title = '';
4650
4649
  this._group = group;
4651
4650
  this.api = new DockviewPanelApiImpl(this, this._group);
4652
4651
  this.addDisposables(this.api.onActiveChange(() => {
@@ -4659,8 +4658,8 @@ class DockviewPanel extends CompositeDisposable {
4659
4658
  }
4660
4659
  init(params) {
4661
4660
  this._params = params.params;
4662
- this.setTitle(params.title);
4663
4661
  this.view.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
4662
+ this.setTitle(params.title);
4664
4663
  }
4665
4664
  focus() {
4666
4665
  this.api._onFocusEvent.fire();
@@ -4677,11 +4676,10 @@ class DockviewPanel extends CompositeDisposable {
4677
4676
  };
4678
4677
  }
4679
4678
  setTitle(title) {
4680
- var _a, _b;
4681
- const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
4679
+ const didTitleChange = title !== this.title;
4682
4680
  if (didTitleChange) {
4683
4681
  this._title = title;
4684
- (_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
4682
+ this.view.update({
4685
4683
  params: {
4686
4684
  params: this._params,
4687
4685
  title: this.title,
@@ -4691,14 +4689,13 @@ class DockviewPanel extends CompositeDisposable {
4691
4689
  }
4692
4690
  }
4693
4691
  update(event) {
4694
- var _a;
4695
4692
  const params = event.params;
4696
4693
  this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
4697
4694
  if (params.title !== this.title) {
4698
4695
  this._title = params.title;
4699
- this.api._onDidTitleChange.fire({ title: this.title });
4696
+ this.api._onDidTitleChange.fire({ title: params.title });
4700
4697
  }
4701
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
4698
+ this.view.update({
4702
4699
  params: {
4703
4700
  params: this._params,
4704
4701
  title: this.title,
@@ -4836,7 +4833,6 @@ class DockviewPanelModel {
4836
4833
  return this._tab;
4837
4834
  }
4838
4835
  constructor(accessor, id, contentComponent, tabComponent) {
4839
- var _a;
4840
4836
  this.accessor = accessor;
4841
4837
  this.id = id;
4842
4838
  this.contentComponent = contentComponent;
@@ -4844,8 +4840,7 @@ class DockviewPanelModel {
4844
4840
  this._group = null;
4845
4841
  this._isPanelVisible = null;
4846
4842
  this._content = this.createContentComponent(this.id, contentComponent);
4847
- this._tab =
4848
- (_a = this.createTabComponent(this.id, tabComponent)) !== null && _a !== void 0 ? _a : new DefaultTab();
4843
+ this._tab = this.createTabComponent(this.id, tabComponent);
4849
4844
  }
4850
4845
  init(params) {
4851
4846
  this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
@@ -4890,8 +4885,16 @@ class DockviewPanelModel {
4890
4885
  return createComponent(id, componentName, this.accessor.options.components || {}, this.accessor.options.frameworkComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
4891
4886
  }
4892
4887
  createTabComponent(id, componentName) {
4893
- var _a;
4894
- return createComponent(id, componentName, this.accessor.options.tabComponents || {}, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4888
+ var _a, _b;
4889
+ if (componentName) {
4890
+ return createComponent(id, componentName, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4891
+ }
4892
+ else if (this.accessor.options.defaultTabComponent) {
4893
+ return createComponent(id, this.accessor.options.defaultTabComponent, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_b = this.accessor.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4894
+ }
4895
+ else {
4896
+ return new DefaultTab();
4897
+ }
4895
4898
  }
4896
4899
  }
4897
4900
 
@@ -4900,7 +4903,7 @@ class DefaultDockviewDeserialzier {
4900
4903
  this.layout = layout;
4901
4904
  }
4902
4905
  fromJSON(panelData, group) {
4903
- var _a, _b, _c;
4906
+ var _a;
4904
4907
  const panelId = panelData.id;
4905
4908
  const params = panelData.params;
4906
4909
  const title = panelData.title;
@@ -4911,15 +4914,6 @@ class DefaultDockviewDeserialzier {
4911
4914
  const tabComponent = viewData
4912
4915
  ? (_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id
4913
4916
  : panelData.tabComponent;
4914
- if (tabComponent) {
4915
- createComponent(panelId, tabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4916
- }
4917
- else if (this.layout.options.defaultTabComponent) {
4918
- createComponent(panelId, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
4919
- }
4920
- else {
4921
- new DefaultTab();
4922
- }
4923
4917
  const view = new DockviewPanelModel(this.layout, panelId, contentComponent, tabComponent);
4924
4918
  const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group, view);
4925
4919
  panel.init({
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.7.1
3
+ * @version 1.7.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -4624,7 +4624,6 @@ class DockviewPanel extends CompositeDisposable {
4624
4624
  this.id = id;
4625
4625
  this.containerApi = containerApi;
4626
4626
  this.view = view;
4627
- this._title = '';
4628
4627
  this._group = group;
4629
4628
  this.api = new DockviewPanelApiImpl(this, this._group);
4630
4629
  this.addDisposables(this.api.onActiveChange(() => {
@@ -4637,8 +4636,8 @@ class DockviewPanel extends CompositeDisposable {
4637
4636
  }
4638
4637
  init(params) {
4639
4638
  this._params = params.params;
4640
- this.setTitle(params.title);
4641
4639
  this.view.init(Object.assign(Object.assign({}, params), { api: this.api, containerApi: this.containerApi }));
4640
+ this.setTitle(params.title);
4642
4641
  }
4643
4642
  focus() {
4644
4643
  this.api._onFocusEvent.fire();
@@ -4655,11 +4654,10 @@ class DockviewPanel extends CompositeDisposable {
4655
4654
  };
4656
4655
  }
4657
4656
  setTitle(title) {
4658
- var _a, _b;
4659
- const didTitleChange = title !== ((_a = this._params) === null || _a === void 0 ? void 0 : _a.title);
4657
+ const didTitleChange = title !== this.title;
4660
4658
  if (didTitleChange) {
4661
4659
  this._title = title;
4662
- (_b = this.view) === null || _b === void 0 ? void 0 : _b.update({
4660
+ this.view.update({
4663
4661
  params: {
4664
4662
  params: this._params,
4665
4663
  title: this.title,
@@ -4669,14 +4667,13 @@ class DockviewPanel extends CompositeDisposable {
4669
4667
  }
4670
4668
  }
4671
4669
  update(event) {
4672
- var _a;
4673
4670
  const params = event.params;
4674
4671
  this._params = Object.assign(Object.assign({}, (this._params || {})), event.params.params);
4675
4672
  if (params.title !== this.title) {
4676
4673
  this._title = params.title;
4677
- this.api._onDidTitleChange.fire({ title: this.title });
4674
+ this.api._onDidTitleChange.fire({ title: params.title });
4678
4675
  }
4679
- (_a = this.view) === null || _a === void 0 ? void 0 : _a.update({
4676
+ this.view.update({
4680
4677
  params: {
4681
4678
  params: this._params,
4682
4679
  title: this.title,
@@ -4814,7 +4811,6 @@ class DockviewPanelModel {
4814
4811
  return this._tab;
4815
4812
  }
4816
4813
  constructor(accessor, id, contentComponent, tabComponent) {
4817
- var _a;
4818
4814
  this.accessor = accessor;
4819
4815
  this.id = id;
4820
4816
  this.contentComponent = contentComponent;
@@ -4822,8 +4818,7 @@ class DockviewPanelModel {
4822
4818
  this._group = null;
4823
4819
  this._isPanelVisible = null;
4824
4820
  this._content = this.createContentComponent(this.id, contentComponent);
4825
- this._tab =
4826
- (_a = this.createTabComponent(this.id, tabComponent)) !== null && _a !== void 0 ? _a : new DefaultTab();
4821
+ this._tab = this.createTabComponent(this.id, tabComponent);
4827
4822
  }
4828
4823
  init(params) {
4829
4824
  this.content.init(Object.assign(Object.assign({}, params), { tab: this.tab }));
@@ -4868,8 +4863,16 @@ class DockviewPanelModel {
4868
4863
  return createComponent(id, componentName, this.accessor.options.components || {}, this.accessor.options.frameworkComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content);
4869
4864
  }
4870
4865
  createTabComponent(id, componentName) {
4871
- var _a;
4872
- return createComponent(id, componentName, this.accessor.options.tabComponents || {}, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4866
+ var _a, _b;
4867
+ if (componentName) {
4868
+ return createComponent(id, componentName, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_a = this.accessor.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.tab, () => new DefaultTab());
4869
+ }
4870
+ else if (this.accessor.options.defaultTabComponent) {
4871
+ return createComponent(id, this.accessor.options.defaultTabComponent, this.accessor.options.tabComponents, this.accessor.options.frameworkTabComponents, (_b = this.accessor.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4872
+ }
4873
+ else {
4874
+ return new DefaultTab();
4875
+ }
4873
4876
  }
4874
4877
  }
4875
4878
 
@@ -4878,7 +4881,7 @@ class DefaultDockviewDeserialzier {
4878
4881
  this.layout = layout;
4879
4882
  }
4880
4883
  fromJSON(panelData, group) {
4881
- var _a, _b, _c;
4884
+ var _a;
4882
4885
  const panelId = panelData.id;
4883
4886
  const params = panelData.params;
4884
4887
  const title = panelData.title;
@@ -4889,15 +4892,6 @@ class DefaultDockviewDeserialzier {
4889
4892
  const tabComponent = viewData
4890
4893
  ? (_a = viewData.tab) === null || _a === void 0 ? void 0 : _a.id
4891
4894
  : panelData.tabComponent;
4892
- if (tabComponent) {
4893
- createComponent(panelId, tabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_b = this.layout.options.frameworkComponentFactory) === null || _b === void 0 ? void 0 : _b.tab, () => new DefaultTab());
4894
- }
4895
- else if (this.layout.options.defaultTabComponent) {
4896
- createComponent(panelId, this.layout.options.defaultTabComponent, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab, () => new DefaultTab());
4897
- }
4898
- else {
4899
- new DefaultTab();
4900
- }
4901
4895
  const view = new DockviewPanelModel(this.layout, panelId, contentComponent, tabComponent);
4902
4896
  const panel = new DockviewPanel(panelId, this.layout, new DockviewApi(this.layout), group, view);
4903
4897
  panel.init({