dockview 1.4.2 → 1.4.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.
Files changed (75) hide show
  1. package/README.md +4 -195
  2. package/dist/cjs/api/component.api.d.ts +5 -0
  3. package/dist/cjs/api/component.api.js +13 -1
  4. package/dist/cjs/api/component.api.js.map +1 -1
  5. package/dist/cjs/dnd/droptarget.d.ts +1 -2
  6. package/dist/cjs/dockview/deserializer.d.ts +0 -12
  7. package/dist/cjs/dockview/deserializer.js +0 -52
  8. package/dist/cjs/dockview/deserializer.js.map +1 -1
  9. package/dist/cjs/dockview/dockviewComponent.d.ts +5 -7
  10. package/dist/cjs/dockview/dockviewComponent.js +77 -40
  11. package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
  12. package/dist/cjs/dockview/options.d.ts +6 -1
  13. package/dist/cjs/gridview/baseComponentGridview.d.ts +4 -2
  14. package/dist/cjs/gridview/baseComponentGridview.js +1 -1
  15. package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
  16. package/dist/cjs/gridview/gridviewComponent.d.ts +1 -0
  17. package/dist/cjs/gridview/gridviewComponent.js +26 -18
  18. package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
  19. package/dist/cjs/groupview/groupview.d.ts +4 -3
  20. package/dist/cjs/groupview/groupview.js +15 -6
  21. package/dist/cjs/groupview/groupview.js.map +1 -1
  22. package/dist/cjs/groupview/groupviewPanel.d.ts +2 -2
  23. package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
  24. package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +2 -2
  25. package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
  26. package/dist/cjs/index.d.ts +1 -0
  27. package/dist/cjs/index.js +1 -0
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/paneview/defaultPaneviewHeader.js +6 -4
  30. package/dist/cjs/paneview/defaultPaneviewHeader.js.map +1 -1
  31. package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
  32. package/dist/cjs/paneview/paneviewComponent.js +19 -16
  33. package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
  34. package/dist/cjs/react/dockview/dockview.d.ts +2 -3
  35. package/dist/cjs/react/dockview/dockview.js.map +1 -1
  36. package/dist/cjs/splitview/splitviewComponent.d.ts +2 -0
  37. package/dist/cjs/splitview/splitviewComponent.js +20 -17
  38. package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
  39. package/dist/dockview.amd.js +122 -87
  40. package/dist/dockview.amd.min.js +2 -2
  41. package/dist/dockview.amd.min.noStyle.js +2 -2
  42. package/dist/dockview.amd.noStyle.js +121 -86
  43. package/dist/dockview.cjs.js +122 -87
  44. package/dist/dockview.esm.js +118 -83
  45. package/dist/dockview.esm.min.js +2 -2
  46. package/dist/dockview.js +122 -87
  47. package/dist/dockview.min.js +2 -2
  48. package/dist/dockview.min.noStyle.js +2 -2
  49. package/dist/dockview.noStyle.js +121 -86
  50. package/dist/esm/api/component.api.d.ts +5 -0
  51. package/dist/esm/api/component.api.js +13 -1
  52. package/dist/esm/dnd/droptarget.d.ts +1 -2
  53. package/dist/esm/dockview/deserializer.d.ts +0 -12
  54. package/dist/esm/dockview/deserializer.js +1 -27
  55. package/dist/esm/dockview/dockviewComponent.d.ts +5 -7
  56. package/dist/esm/dockview/dockviewComponent.js +49 -23
  57. package/dist/esm/dockview/options.d.ts +6 -1
  58. package/dist/esm/gridview/baseComponentGridview.d.ts +4 -2
  59. package/dist/esm/gridview/baseComponentGridview.js +1 -1
  60. package/dist/esm/gridview/gridviewComponent.d.ts +1 -0
  61. package/dist/esm/gridview/gridviewComponent.js +15 -7
  62. package/dist/esm/groupview/groupview.d.ts +4 -3
  63. package/dist/esm/groupview/groupview.js +15 -6
  64. package/dist/esm/groupview/groupviewPanel.d.ts +2 -2
  65. package/dist/esm/groupview/titlebar/tabsContainer.d.ts +2 -2
  66. package/dist/esm/index.d.ts +1 -0
  67. package/dist/esm/index.js +1 -0
  68. package/dist/esm/paneview/defaultPaneviewHeader.js +6 -4
  69. package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
  70. package/dist/esm/paneview/paneviewComponent.js +8 -5
  71. package/dist/esm/react/dockview/dockview.d.ts +2 -3
  72. package/dist/esm/splitview/splitviewComponent.d.ts +2 -0
  73. package/dist/esm/splitview/splitviewComponent.js +9 -6
  74. package/dist/styles/dockview.css +5 -0
  75. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.4.2
3
+ * @version 1.4.3
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -2294,6 +2294,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2294
2294
  toJSON() {
2295
2295
  return this.component.toJSON();
2296
2296
  }
2297
+ clear() {
2298
+ this.component.clear();
2299
+ }
2297
2300
  }
2298
2301
  class PaneviewApi {
2299
2302
  constructor(component) {
@@ -2361,6 +2364,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2361
2364
  toJSON() {
2362
2365
  return this.component.toJSON();
2363
2366
  }
2367
+ clear() {
2368
+ this.component.clear();
2369
+ }
2364
2370
  }
2365
2371
  class GridviewApi {
2366
2372
  constructor(component) {
@@ -2432,6 +2438,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2432
2438
  toJSON() {
2433
2439
  return this.component.toJSON();
2434
2440
  }
2441
+ clear() {
2442
+ this.component.clear();
2443
+ }
2435
2444
  }
2436
2445
  class DockviewApi {
2437
2446
  constructor(component) {
@@ -2480,7 +2489,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2480
2489
  return this.component.onDidRemovePanel;
2481
2490
  }
2482
2491
  get onDidLayoutFromJSON() {
2483
- return this.component.onDidLayoutfromJSON;
2492
+ return this.component.onDidLayoutFromJSON;
2484
2493
  }
2485
2494
  get onDidLayoutChange() {
2486
2495
  return this.component.onDidLayoutChange;
@@ -2542,6 +2551,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2542
2551
  toJSON() {
2543
2552
  return this.component.toJSON();
2544
2553
  }
2554
+ clear() {
2555
+ this.component.clear();
2556
+ }
2545
2557
  }
2546
2558
 
2547
2559
  class ContentContainer extends CompositeDisposable {
@@ -2615,12 +2627,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2615
2627
  }
2616
2628
  }
2617
2629
 
2618
- var DockviewDropTargets;
2630
+ exports.DockviewDropTargets = void 0;
2619
2631
  (function (DockviewDropTargets) {
2620
2632
  DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
2621
2633
  DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
2622
2634
  DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
2623
- })(DockviewDropTargets || (DockviewDropTargets = {}));
2635
+ })(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
2624
2636
 
2625
2637
  class DragHandler extends CompositeDisposable {
2626
2638
  constructor(el) {
@@ -2719,7 +2731,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2719
2731
  if (data) {
2720
2732
  return this.panelId !== data.panelId;
2721
2733
  }
2722
- return this.group.model.canDisplayOverlay(event, DockviewDropTargets.Tab);
2734
+ return this.group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Tab);
2723
2735
  },
2724
2736
  });
2725
2737
  this.addDisposables(this.droptarget.onDrop((event) => {
@@ -2778,7 +2790,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2778
2790
  // don't show the overlay if the tab being dragged is the last panel of this group
2779
2791
  return ((_a = last(this.tabs)) === null || _a === void 0 ? void 0 : _a.value.panelId) !== data.panelId;
2780
2792
  }
2781
- return group.model.canDisplayOverlay(event, DockviewDropTargets.Panel);
2793
+ return group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2782
2794
  },
2783
2795
  });
2784
2796
  this.addDisposables(this.voidDropTarget.onDrop((event) => {
@@ -2976,7 +2988,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2976
2988
  const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
2977
2989
  return !groupHasOnePanelAndIsActiveDragElement;
2978
2990
  }
2979
- return this.canDisplayOverlay(event, DockviewDropTargets.Panel);
2991
+ return this.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
2980
2992
  },
2981
2993
  });
2982
2994
  container.append(this.tabsContainer.element, this.contentContainer.element);
@@ -3134,16 +3146,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3134
3146
  options.index > this.panels.length) {
3135
3147
  options.index = this.panels.length;
3136
3148
  }
3137
- const skipSetActive = !!options.skipSetActive;
3149
+ const skipSetPanelActive = !!options.skipSetPanelActive;
3150
+ const skipSetGroupActive = !!options.skipSetGroupActive;
3138
3151
  // ensure the group is updated before we fire any events
3139
3152
  panel.updateParentGroup(this.parent, true);
3140
- if (!skipSetActive && this._activePanel === panel) {
3141
- this.accessor.doSetGroupActive(this.parent);
3153
+ if (this._activePanel === panel) {
3154
+ if (!skipSetGroupActive) {
3155
+ this.accessor.doSetGroupActive(this.parent);
3156
+ }
3142
3157
  return;
3143
3158
  }
3144
- this.doAddPanel(panel, options.index, skipSetActive);
3145
- if (!skipSetActive) {
3159
+ this.doAddPanel(panel, options.index, skipSetPanelActive);
3160
+ if (!skipSetPanelActive) {
3146
3161
  this.doSetActivePanel(panel);
3162
+ }
3163
+ if (!skipSetGroupActive) {
3147
3164
  this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
3148
3165
  }
3149
3166
  this.updateContainer();
@@ -3319,7 +3336,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3319
3336
  canDisplayOverlay(event, target) {
3320
3337
  // custom overlay handler
3321
3338
  if (this.accessor.options.showDndOverlay) {
3322
- return this.accessor.options.showDndOverlay(event, target);
3339
+ return this.accessor.options.showDndOverlay({
3340
+ nativeEvent: event,
3341
+ target,
3342
+ group: this.accessor.getPanel(this.id),
3343
+ });
3323
3344
  }
3324
3345
  return false;
3325
3346
  }
@@ -3402,7 +3423,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3402
3423
  this.element.appendChild(this.gridview.element);
3403
3424
  this.layout(0, 0, true); // set some elements height/widths
3404
3425
  this.addDisposables(this.gridview.onDidChange(() => {
3405
- this._onDidLayoutChange.fire();
3426
+ this._bufferOnDidLayoutChange.fire();
3406
3427
  }));
3407
3428
  this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
3408
3429
  this._bufferOnDidLayoutChange.fire();
@@ -3912,34 +3933,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3912
3933
  }
3913
3934
  }
3914
3935
 
3915
- class DefaultDeserializer {
3916
- constructor(layout, panelDeserializer) {
3917
- this.layout = layout;
3918
- this.panelDeserializer = panelDeserializer;
3919
- }
3920
- fromJSON(node) {
3921
- const data = node.data;
3922
- const children = data.views;
3923
- const active = data.activeView;
3924
- const group = this.layout.createGroup({
3925
- id: data.id,
3926
- locked: !!data.locked,
3927
- hideHeader: !!data.hideHeader,
3928
- });
3929
- for (const child of children) {
3930
- const panel = this.panelDeserializer.createPanel(child, group);
3931
- const isActive = typeof active === 'string' && active === panel.id;
3932
- group.model.openPanel(panel, {
3933
- skipSetActive: !isActive,
3934
- });
3935
- }
3936
- if (!group.activePanel && group.panels.length > 0) {
3937
- group.model.openPanel(group.panels[group.panels.length - 1]);
3938
- }
3939
- return group;
3940
- }
3941
- }
3942
-
3943
3936
  function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
3944
3937
  const Component = typeof componentName === 'string'
3945
3938
  ? components[componentName]
@@ -4376,9 +4369,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4376
4369
  orientation: options.orientation || exports.Orientation.HORIZONTAL,
4377
4370
  styles: options.styles,
4378
4371
  });
4379
- // events
4380
- this._onTabInteractionEvent = new Emitter();
4381
- this.onTabInteractionEvent = this._onTabInteractionEvent.event;
4382
4372
  this._onTabContextMenu = new Emitter();
4383
4373
  this.onTabContextMenu = this._onTabContextMenu.event;
4384
4374
  this._onDidDrop = new Emitter();
@@ -4387,11 +4377,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4387
4377
  this.onDidRemovePanel = this._onDidRemovePanel.event;
4388
4378
  this._onDidAddPanel = new Emitter();
4389
4379
  this.onDidAddPanel = this._onDidAddPanel.event;
4390
- this._onDidLayoutfromJSON = new Emitter();
4391
- this.onDidLayoutfromJSON = this._onDidLayoutfromJSON.event;
4380
+ this._onDidLayoutFromJSON = new Emitter();
4381
+ this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
4392
4382
  this._onDidActivePanelChange = new Emitter();
4393
4383
  this.onDidActivePanelChange = this._onDidActivePanelChange.event;
4394
- this.addDisposables(this._onTabInteractionEvent, this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4384
+ this.addDisposables(this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
4395
4385
  this._bufferOnDidLayoutChange.fire();
4396
4386
  }));
4397
4387
  this._options = options;
@@ -4446,7 +4436,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4446
4436
  }
4447
4437
  updateOptions(options) {
4448
4438
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4449
- this.options.orientation !== options.orientation;
4439
+ this.gridview.orientation !== options.orientation;
4450
4440
  this._options = Object.assign(Object.assign({}, this.options), options);
4451
4441
  if (hasOrientationChanged) {
4452
4442
  this.gridview.orientation = options.orientation;
@@ -4524,12 +4514,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4524
4514
  };
4525
4515
  }
4526
4516
  fromJSON(data) {
4527
- const groups = Array.from(this._groups.values()).map((_) => _.value);
4528
- for (const group of groups) {
4529
- // remove the group will automatically remove the panels
4530
- this.removeGroup(group, true);
4531
- }
4532
- this.gridview.clear();
4517
+ this.clear();
4533
4518
  if (!this.deserializer) {
4534
4519
  throw new Error('invalid deserializer');
4535
4520
  }
@@ -4540,12 +4525,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4540
4525
  if (!this.deserializer) {
4541
4526
  throw new Error('no deserializer provided');
4542
4527
  }
4543
- this.gridview.deserialize(grid, new DefaultDeserializer(this, {
4544
- createPanel: (id, group) => {
4545
- const panelData = panels[id];
4546
- return this.deserializer.fromJSON(panelData, group);
4547
- },
4548
- }));
4528
+ this.gridview.deserialize(grid, {
4529
+ fromJSON: (node) => {
4530
+ const { id, locked, hideHeader, views, activeView } = node.data;
4531
+ const group = this.createGroup({
4532
+ id,
4533
+ locked: !!locked,
4534
+ hideHeader: !!hideHeader,
4535
+ });
4536
+ this._onDidAddGroup.fire(group);
4537
+ for (const child of views) {
4538
+ const panel = this.deserializer.fromJSON(panels[child], group);
4539
+ const isActive = typeof activeView === 'string' && activeView === panel.id;
4540
+ group.model.openPanel(panel, {
4541
+ skipSetPanelActive: !isActive,
4542
+ skipSetGroupActive: true
4543
+ });
4544
+ }
4545
+ if (!group.activePanel && group.panels.length > 0) {
4546
+ group.model.openPanel(group.panels[group.panels.length - 1], {
4547
+ skipSetGroupActive: true
4548
+ });
4549
+ }
4550
+ return group;
4551
+ }
4552
+ });
4549
4553
  if (typeof activeGroup === 'string') {
4550
4554
  const panel = this.getPanel(activeGroup);
4551
4555
  if (panel) {
@@ -4553,7 +4557,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4553
4557
  }
4554
4558
  }
4555
4559
  this.gridview.layout(this.width, this.height);
4556
- this._onDidLayoutfromJSON.fire();
4560
+ this._onDidLayoutFromJSON.fire();
4561
+ }
4562
+ clear() {
4563
+ const groups = Array.from(this._groups.values()).map((_) => _.value);
4564
+ const hasActiveGroup = !!this.activeGroup;
4565
+ const hasActivePanel = !!this.activePanel;
4566
+ for (const group of groups) {
4567
+ // remove the group will automatically remove the panels
4568
+ this.removeGroup(group, true);
4569
+ }
4570
+ if (hasActiveGroup) {
4571
+ this.doSetGroupActive(undefined);
4572
+ }
4573
+ if (hasActivePanel) {
4574
+ this._onDidActivePanelChange.fire(undefined);
4575
+ }
4576
+ this.gridview.clear();
4557
4577
  }
4558
4578
  closeAllGroups() {
4559
4579
  for (const entry of this._groups.entries()) {
@@ -4751,7 +4771,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4751
4771
  const { groupId, itemId, target, index } = event;
4752
4772
  this.moveGroupOrPanel(view, groupId, itemId, target, index);
4753
4773
  }), view.model.onDidDrop((event) => {
4754
- this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
4774
+ this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: view }));
4755
4775
  }), view.model.onDidGroupChange((event) => {
4756
4776
  switch (event.kind) {
4757
4777
  case exports.GroupChangeKind2.ADD_PANEL:
@@ -4815,7 +4835,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4815
4835
  this._onDidActivePanelChange.dispose();
4816
4836
  this._onDidAddPanel.dispose();
4817
4837
  this._onDidRemovePanel.dispose();
4818
- this._onDidLayoutfromJSON.dispose();
4838
+ this._onDidLayoutFromJSON.dispose();
4819
4839
  }
4820
4840
  }
4821
4841
 
@@ -4853,7 +4873,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4853
4873
  }
4854
4874
  updateOptions(options) {
4855
4875
  const hasOrientationChanged = typeof options.orientation === 'string' &&
4856
- this.options.orientation !== options.orientation;
4876
+ this.gridview.orientation !== options.orientation;
4857
4877
  this._options = Object.assign(Object.assign({}, this.options), options);
4858
4878
  if (hasOrientationChanged) {
4859
4879
  this.gridview.orientation = options.orientation;
@@ -4889,13 +4909,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4889
4909
  (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
4890
4910
  }
4891
4911
  fromJSON(serializedGridview) {
4912
+ this.clear();
4892
4913
  const { grid, activePanel } = serializedGridview;
4893
- const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4894
- for (const group of groups) {
4895
- group.disposable.dispose();
4896
- this.doRemoveGroup(group.value, { skipActive: true });
4897
- }
4898
- this.gridview.clear();
4899
4914
  const queue = [];
4900
4915
  this.gridview.deserialize(grid, {
4901
4916
  fromJSON: (node) => {
@@ -4917,6 +4932,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4917
4932
  accessor: this,
4918
4933
  isVisible: node.visible,
4919
4934
  }));
4935
+ this._onDidAddGroup.fire(view);
4920
4936
  this.registerPanel(view);
4921
4937
  return view;
4922
4938
  },
@@ -4931,6 +4947,18 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
4931
4947
  }
4932
4948
  this._onDidLayoutfromJSON.fire();
4933
4949
  }
4950
+ clear() {
4951
+ const hasActiveGroup = this.activeGroup;
4952
+ const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
4953
+ for (const group of groups) {
4954
+ group.disposable.dispose();
4955
+ this.doRemoveGroup(group.value, { skipActive: true });
4956
+ }
4957
+ if (hasActiveGroup) {
4958
+ this.doSetGroupActive(undefined);
4959
+ }
4960
+ this.gridview.clear();
4961
+ }
4934
4962
  movePanel(panel, options) {
4935
4963
  var _a;
4936
4964
  let relativeLocation;
@@ -5221,13 +5249,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5221
5249
  };
5222
5250
  }
5223
5251
  fromJSON(serializedSplitview) {
5252
+ this.clear();
5224
5253
  const { views, orientation, size, activeView } = serializedSplitview;
5225
- for (const [_, value] of this._panels.entries()) {
5226
- value.disposable.dispose();
5227
- value.value.dispose();
5228
- }
5229
- this._panels.clear();
5230
- this.splitview.dispose();
5231
5254
  const queue = [];
5232
5255
  this.splitview = new Splitview(this.element, {
5233
5256
  orientation,
@@ -5275,6 +5298,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5275
5298
  }
5276
5299
  this._onDidLayoutfromJSON.fire();
5277
5300
  }
5301
+ clear() {
5302
+ for (const [_, value] of this._panels.entries()) {
5303
+ value.disposable.dispose();
5304
+ value.value.dispose();
5305
+ }
5306
+ this._panels.clear();
5307
+ this.splitview.dispose();
5308
+ }
5278
5309
  dispose() {
5279
5310
  for (const [_, value] of this._panels.entries()) {
5280
5311
  value.disposable.dispose();
@@ -5603,9 +5634,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5603
5634
  this.element.className = 'default-header';
5604
5635
  this._content = document.createElement('span');
5605
5636
  this._expander = document.createElement('a');
5606
- this.element.appendChild(this._content);
5607
5637
  this.element.appendChild(this._expander);
5608
- this.addDisposables(addDisposableListener(this._expander, 'click', () => {
5638
+ this.element.appendChild(this._content);
5639
+ this.addDisposables(addDisposableListener(this._element, 'click', () => {
5609
5640
  var _a;
5610
5641
  (_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.setExpanded(!this.apiRef.api.isExpanded);
5611
5642
  }));
@@ -5616,9 +5647,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5616
5647
  init(params) {
5617
5648
  this.apiRef.api = params.api;
5618
5649
  this._content.textContent = params.title;
5619
- this._expander.textContent = params.api.isExpanded ? '<' : '>';
5650
+ this._expander.textContent = '';
5651
+ toggleClass(this._expander, 'collapsed', !params.api.isExpanded);
5620
5652
  this.disposable.value = params.api.onDidExpansionChange((e) => {
5621
- this._expander.textContent = e.isExpanded ? '<' : '>';
5653
+ toggleClass(this._expander, 'collapsed', !e.isExpanded);
5622
5654
  });
5623
5655
  }
5624
5656
  update(_params) {
@@ -5794,13 +5826,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5794
5826
  };
5795
5827
  }
5796
5828
  fromJSON(serializedPaneview) {
5829
+ this.clear();
5797
5830
  const { views, size } = serializedPaneview;
5798
5831
  const queue = [];
5799
- for (const [_, value] of this._viewDisposables.entries()) {
5800
- value.dispose();
5801
- }
5802
- this._viewDisposables.clear();
5803
- this.paneview.dispose();
5804
5832
  this.paneview = new Paneview(this.element, {
5805
5833
  orientation: exports.Orientation.VERTICAL,
5806
5834
  descriptor: {
@@ -5859,6 +5887,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5859
5887
  queue.forEach((f) => f());
5860
5888
  this._onDidLayoutfromJSON.fire();
5861
5889
  }
5890
+ clear() {
5891
+ for (const [_, value] of this._viewDisposables.entries()) {
5892
+ value.dispose();
5893
+ }
5894
+ this._viewDisposables.clear();
5895
+ this.paneview.dispose();
5896
+ }
5862
5897
  doAddPanel(panel) {
5863
5898
  const disposable = panel.onDidDrop((event) => {
5864
5899
  this._onDidDrop.fire(event);