dockview 1.4.0 → 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.
- package/README.md +4 -195
- package/dist/cjs/api/component.api.d.ts +8 -8
- package/dist/cjs/api/component.api.js +16 -19
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +1 -2
- package/dist/cjs/api/panelApi.js +3 -3
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +1 -2
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -17
- package/dist/cjs/dockview/components/tab/defaultTab.js +9 -64
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +1 -2
- package/dist/cjs/dockview/defaultGroupPanelView.js +2 -4
- package/dist/cjs/dockview/defaultGroupPanelView.js.map +1 -1
- package/dist/cjs/dockview/deserializer.d.ts +0 -12
- package/dist/cjs/dockview/deserializer.js +0 -52
- package/dist/cjs/dockview/deserializer.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +5 -7
- package/dist/cjs/dockview/dockviewComponent.js +79 -42
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +6 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +4 -2
- package/dist/cjs/gridview/baseComponentGridview.js +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.js +1 -1
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +1 -1
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +1 -2
- package/dist/cjs/gridview/gridviewComponent.js +28 -24
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +2 -3
- package/dist/cjs/gridview/gridviewPanel.js +4 -4
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/groupview/groupview.d.ts +4 -3
- package/dist/cjs/groupview/groupview.js +20 -8
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +2 -2
- package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
- package/dist/cjs/groupview/tab.js +1 -0
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +3 -5
- package/dist/cjs/groupview/titlebar/tabsContainer.js +2 -4
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/types.d.ts +1 -3
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js +6 -4
- package/dist/cjs/paneview/defaultPaneviewHeader.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -0
- package/dist/cjs/paneview/paneviewComponent.js +20 -17
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +2 -3
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.d.ts +2 -4
- package/dist/cjs/react/dockview/reactContentPart.js +0 -3
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +0 -1
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +0 -3
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js.map +1 -1
- package/dist/cjs/react/gridview/view.js +2 -2
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +0 -1
- package/dist/cjs/react/index.js +0 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.js.map +1 -1
- package/dist/cjs/splitview/core/options.d.ts +2 -2
- package/dist/cjs/splitview/splitviewComponent.d.ts +2 -1
- package/dist/cjs/splitview/splitviewComponent.js +23 -21
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.js +4 -6
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/dockview.amd.js +165 -250
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +164 -249
- package/dist/dockview.cjs.js +165 -250
- package/dist/dockview.esm.js +160 -244
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +165 -250
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +164 -249
- package/dist/esm/api/component.api.d.ts +8 -8
- package/dist/esm/api/component.api.js +16 -19
- package/dist/esm/api/panelApi.d.ts +1 -2
- package/dist/esm/api/panelApi.js +3 -3
- package/dist/esm/dnd/droptarget.d.ts +1 -2
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -17
- package/dist/esm/dockview/components/tab/defaultTab.js +8 -49
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +1 -2
- package/dist/esm/dockview/defaultGroupPanelView.js +3 -5
- package/dist/esm/dockview/deserializer.d.ts +0 -12
- package/dist/esm/dockview/deserializer.js +1 -27
- package/dist/esm/dockview/dockviewComponent.d.ts +5 -7
- package/dist/esm/dockview/dockviewComponent.js +50 -24
- package/dist/esm/dockview/dockviewGroupPanel.js +1 -1
- package/dist/esm/dockview/options.d.ts +6 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +4 -2
- package/dist/esm/gridview/baseComponentGridview.js +1 -1
- package/dist/esm/gridview/basePanelView.js +1 -1
- package/dist/esm/gridview/gridviewComponent.d.ts +1 -2
- package/dist/esm/gridview/gridviewComponent.js +17 -13
- package/dist/esm/gridview/gridviewPanel.d.ts +2 -3
- package/dist/esm/gridview/gridviewPanel.js +4 -4
- package/dist/esm/groupview/groupview.d.ts +4 -3
- package/dist/esm/groupview/groupview.js +19 -8
- package/dist/esm/groupview/groupviewPanel.d.ts +2 -2
- package/dist/esm/groupview/tab.js +1 -0
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +3 -5
- package/dist/esm/groupview/titlebar/tabsContainer.js +2 -4
- package/dist/esm/groupview/types.d.ts +1 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/paneview/defaultPaneviewHeader.js +6 -4
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -0
- package/dist/esm/paneview/paneviewComponent.js +8 -5
- package/dist/esm/react/dockview/dockview.d.ts +2 -3
- package/dist/esm/react/dockview/reactContentPart.d.ts +2 -4
- package/dist/esm/react/dockview/reactContentPart.js +0 -3
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +0 -1
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +0 -3
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +0 -1
- package/dist/esm/react/index.js +0 -1
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/core/options.d.ts +2 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +2 -1
- package/dist/esm/splitview/splitviewComponent.js +11 -9
- package/dist/esm/splitview/splitviewPanel.js +4 -6
- package/dist/styles/dockview.css +5 -0
- package/package.json +2 -2
- package/dist/cjs/react/dockview/components.d.ts +0 -11
- package/dist/cjs/react/dockview/components.js +0 -81
- package/dist/cjs/react/dockview/components.js.map +0 -1
- package/dist/esm/react/dockview/components.d.ts +0 -11
- package/dist/esm/react/dockview/components.js +0 -54
package/dist/dockview.noStyle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 1.4.
|
|
3
|
+
* @version 1.4.3
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -2277,18 +2277,12 @@
|
|
|
2277
2277
|
removePanel(panel, sizing) {
|
|
2278
2278
|
this.component.removePanel(panel, sizing);
|
|
2279
2279
|
}
|
|
2280
|
-
setVisible(panel, isVisible) {
|
|
2281
|
-
this.component.setVisible(panel, isVisible);
|
|
2282
|
-
}
|
|
2283
2280
|
focus() {
|
|
2284
2281
|
this.component.focus();
|
|
2285
2282
|
}
|
|
2286
2283
|
getPanel(id) {
|
|
2287
2284
|
return this.component.getPanel(id);
|
|
2288
2285
|
}
|
|
2289
|
-
setActive(panel) {
|
|
2290
|
-
this.component.setActive(panel);
|
|
2291
|
-
}
|
|
2292
2286
|
layout(width, height) {
|
|
2293
2287
|
return this.component.layout(width, height);
|
|
2294
2288
|
}
|
|
@@ -2304,6 +2298,9 @@
|
|
|
2304
2298
|
toJSON() {
|
|
2305
2299
|
return this.component.toJSON();
|
|
2306
2300
|
}
|
|
2301
|
+
clear() {
|
|
2302
|
+
this.component.clear();
|
|
2303
|
+
}
|
|
2307
2304
|
}
|
|
2308
2305
|
class PaneviewApi {
|
|
2309
2306
|
constructor(component) {
|
|
@@ -2371,6 +2368,9 @@
|
|
|
2371
2368
|
toJSON() {
|
|
2372
2369
|
return this.component.toJSON();
|
|
2373
2370
|
}
|
|
2371
|
+
clear() {
|
|
2372
|
+
this.component.clear();
|
|
2373
|
+
}
|
|
2374
2374
|
}
|
|
2375
2375
|
class GridviewApi {
|
|
2376
2376
|
constructor(component) {
|
|
@@ -2397,13 +2397,13 @@
|
|
|
2397
2397
|
get onDidLayoutChange() {
|
|
2398
2398
|
return this.component.onDidLayoutChange;
|
|
2399
2399
|
}
|
|
2400
|
-
get
|
|
2400
|
+
get onDidAddPanel() {
|
|
2401
2401
|
return this.component.onDidAddGroup;
|
|
2402
2402
|
}
|
|
2403
|
-
get
|
|
2403
|
+
get onDidRemovePanel() {
|
|
2404
2404
|
return this.component.onDidRemoveGroup;
|
|
2405
2405
|
}
|
|
2406
|
-
get
|
|
2406
|
+
get onDidActivePanelChange() {
|
|
2407
2407
|
return this.component.onDidActiveGroupChange;
|
|
2408
2408
|
}
|
|
2409
2409
|
get onDidLayoutFromJSON() {
|
|
@@ -2436,21 +2436,15 @@
|
|
|
2436
2436
|
getPanel(id) {
|
|
2437
2437
|
return this.component.getPanel(id);
|
|
2438
2438
|
}
|
|
2439
|
-
toggleVisibility(panel) {
|
|
2440
|
-
this.component.toggleVisibility(panel);
|
|
2441
|
-
}
|
|
2442
|
-
setVisible(panel, visible) {
|
|
2443
|
-
this.component.setVisible(panel, visible);
|
|
2444
|
-
}
|
|
2445
|
-
setActive(panel) {
|
|
2446
|
-
this.component.setActive(panel);
|
|
2447
|
-
}
|
|
2448
2439
|
fromJSON(data) {
|
|
2449
2440
|
return this.component.fromJSON(data);
|
|
2450
2441
|
}
|
|
2451
2442
|
toJSON() {
|
|
2452
2443
|
return this.component.toJSON();
|
|
2453
2444
|
}
|
|
2445
|
+
clear() {
|
|
2446
|
+
this.component.clear();
|
|
2447
|
+
}
|
|
2454
2448
|
}
|
|
2455
2449
|
class DockviewApi {
|
|
2456
2450
|
constructor(component) {
|
|
@@ -2499,7 +2493,7 @@
|
|
|
2499
2493
|
return this.component.onDidRemovePanel;
|
|
2500
2494
|
}
|
|
2501
2495
|
get onDidLayoutFromJSON() {
|
|
2502
|
-
return this.component.
|
|
2496
|
+
return this.component.onDidLayoutFromJSON;
|
|
2503
2497
|
}
|
|
2504
2498
|
get onDidLayoutChange() {
|
|
2505
2499
|
return this.component.onDidLayoutChange;
|
|
@@ -2561,6 +2555,9 @@
|
|
|
2561
2555
|
toJSON() {
|
|
2562
2556
|
return this.component.toJSON();
|
|
2563
2557
|
}
|
|
2558
|
+
clear() {
|
|
2559
|
+
this.component.clear();
|
|
2560
|
+
}
|
|
2564
2561
|
}
|
|
2565
2562
|
|
|
2566
2563
|
class ContentContainer extends CompositeDisposable {
|
|
@@ -2634,12 +2631,12 @@
|
|
|
2634
2631
|
}
|
|
2635
2632
|
}
|
|
2636
2633
|
|
|
2637
|
-
|
|
2634
|
+
exports.DockviewDropTargets = void 0;
|
|
2638
2635
|
(function (DockviewDropTargets) {
|
|
2639
2636
|
DockviewDropTargets[DockviewDropTargets["Tab"] = 0] = "Tab";
|
|
2640
2637
|
DockviewDropTargets[DockviewDropTargets["Panel"] = 1] = "Panel";
|
|
2641
2638
|
DockviewDropTargets[DockviewDropTargets["TabContainer"] = 2] = "TabContainer";
|
|
2642
|
-
})(DockviewDropTargets || (DockviewDropTargets = {}));
|
|
2639
|
+
})(exports.DockviewDropTargets || (exports.DockviewDropTargets = {}));
|
|
2643
2640
|
|
|
2644
2641
|
class DragHandler extends CompositeDisposable {
|
|
2645
2642
|
constructor(el) {
|
|
@@ -2681,7 +2678,7 @@
|
|
|
2681
2678
|
MouseEventKind["CLICK"] = "CLICK";
|
|
2682
2679
|
MouseEventKind["CONTEXT_MENU"] = "CONTEXT_MENU";
|
|
2683
2680
|
})(exports.MouseEventKind || (exports.MouseEventKind = {}));
|
|
2684
|
-
class Tab
|
|
2681
|
+
class Tab extends CompositeDisposable {
|
|
2685
2682
|
constructor(panelId, accessor, group) {
|
|
2686
2683
|
super();
|
|
2687
2684
|
this.panelId = panelId;
|
|
@@ -2695,6 +2692,7 @@
|
|
|
2695
2692
|
this._element.className = 'tab';
|
|
2696
2693
|
this._element.tabIndex = 0;
|
|
2697
2694
|
this._element.draggable = true;
|
|
2695
|
+
toggleClass(this.element, 'inactive-tab', true);
|
|
2698
2696
|
this.addDisposables(new (class Handler extends DragHandler {
|
|
2699
2697
|
constructor() {
|
|
2700
2698
|
super(...arguments);
|
|
@@ -2737,7 +2735,7 @@
|
|
|
2737
2735
|
if (data) {
|
|
2738
2736
|
return this.panelId !== data.panelId;
|
|
2739
2737
|
}
|
|
2740
|
-
return this.group.model.canDisplayOverlay(event, DockviewDropTargets.Tab);
|
|
2738
|
+
return this.group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Tab);
|
|
2741
2739
|
},
|
|
2742
2740
|
});
|
|
2743
2741
|
this.addDisposables(this.droptarget.onDrop((event) => {
|
|
@@ -2771,7 +2769,6 @@
|
|
|
2771
2769
|
this.group = group;
|
|
2772
2770
|
this.tabs = [];
|
|
2773
2771
|
this.selectedIndex = -1;
|
|
2774
|
-
this.active = false;
|
|
2775
2772
|
this._hidden = false;
|
|
2776
2773
|
this._onDrop = new Emitter();
|
|
2777
2774
|
this.onDrop = this._onDrop.event;
|
|
@@ -2797,7 +2794,7 @@
|
|
|
2797
2794
|
// don't show the overlay if the tab being dragged is the last panel of this group
|
|
2798
2795
|
return ((_a = last(this.tabs)) === null || _a === void 0 ? void 0 : _a.value.panelId) !== data.panelId;
|
|
2799
2796
|
}
|
|
2800
|
-
return group.model.canDisplayOverlay(event, DockviewDropTargets.Panel);
|
|
2797
|
+
return group.model.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
|
|
2801
2798
|
},
|
|
2802
2799
|
});
|
|
2803
2800
|
this.addDisposables(this.voidDropTarget.onDrop((event) => {
|
|
@@ -2875,8 +2872,8 @@
|
|
|
2875
2872
|
indexOf(id) {
|
|
2876
2873
|
return this.tabs.findIndex((tab) => tab.value.panelId === id);
|
|
2877
2874
|
}
|
|
2878
|
-
setActive(
|
|
2879
|
-
|
|
2875
|
+
setActive(_isGroupActive) {
|
|
2876
|
+
// noop
|
|
2880
2877
|
}
|
|
2881
2878
|
addTab(tab, index = this.tabs.length) {
|
|
2882
2879
|
if (index < 0 || index > this.tabs.length) {
|
|
@@ -2910,7 +2907,7 @@
|
|
|
2910
2907
|
if (this.tabs.find((tab) => tab.value.panelId === panel.id)) {
|
|
2911
2908
|
return;
|
|
2912
2909
|
}
|
|
2913
|
-
const tabToAdd = new Tab
|
|
2910
|
+
const tabToAdd = new Tab(panel.id, this.accessor, this.group);
|
|
2914
2911
|
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
2915
2912
|
throw new Error('invalid header component');
|
|
2916
2913
|
}
|
|
@@ -2937,7 +2934,6 @@
|
|
|
2937
2934
|
}));
|
|
2938
2935
|
const value = { value: tabToAdd, disposable };
|
|
2939
2936
|
this.addTab(value, index);
|
|
2940
|
-
this.activePanel = panel;
|
|
2941
2937
|
}
|
|
2942
2938
|
closePanel(panel) {
|
|
2943
2939
|
this.delete(panel.id);
|
|
@@ -2996,7 +2992,7 @@
|
|
|
2996
2992
|
const groupHasOnePanelAndIsActiveDragElement = this._panels.length === 1 && data.groupId === this.id;
|
|
2997
2993
|
return !groupHasOnePanelAndIsActiveDragElement;
|
|
2998
2994
|
}
|
|
2999
|
-
return this.canDisplayOverlay(event, DockviewDropTargets.Panel);
|
|
2995
|
+
return this.canDisplayOverlay(event, exports.DockviewDropTargets.Panel);
|
|
3000
2996
|
},
|
|
3001
2997
|
});
|
|
3002
2998
|
container.append(this.tabsContainer.element, this.contentContainer.element);
|
|
@@ -3154,16 +3150,21 @@
|
|
|
3154
3150
|
options.index > this.panels.length) {
|
|
3155
3151
|
options.index = this.panels.length;
|
|
3156
3152
|
}
|
|
3157
|
-
const
|
|
3153
|
+
const skipSetPanelActive = !!options.skipSetPanelActive;
|
|
3154
|
+
const skipSetGroupActive = !!options.skipSetGroupActive;
|
|
3158
3155
|
// ensure the group is updated before we fire any events
|
|
3159
3156
|
panel.updateParentGroup(this.parent, true);
|
|
3160
|
-
if (
|
|
3161
|
-
|
|
3157
|
+
if (this._activePanel === panel) {
|
|
3158
|
+
if (!skipSetGroupActive) {
|
|
3159
|
+
this.accessor.doSetGroupActive(this.parent);
|
|
3160
|
+
}
|
|
3162
3161
|
return;
|
|
3163
3162
|
}
|
|
3164
|
-
this.doAddPanel(panel, options.index);
|
|
3165
|
-
if (!
|
|
3163
|
+
this.doAddPanel(panel, options.index, skipSetPanelActive);
|
|
3164
|
+
if (!skipSetPanelActive) {
|
|
3166
3165
|
this.doSetActivePanel(panel);
|
|
3166
|
+
}
|
|
3167
|
+
if (!skipSetGroupActive) {
|
|
3167
3168
|
this.accessor.doSetGroupActive(this.parent, !!options.skipFocus);
|
|
3168
3169
|
}
|
|
3169
3170
|
this.updateContainer();
|
|
@@ -3267,11 +3268,13 @@
|
|
|
3267
3268
|
panel,
|
|
3268
3269
|
});
|
|
3269
3270
|
}
|
|
3270
|
-
doAddPanel(panel, index = this.panels.length) {
|
|
3271
|
+
doAddPanel(panel, index = this.panels.length, skipSetActive = false) {
|
|
3271
3272
|
const existingPanel = this._panels.indexOf(panel);
|
|
3272
3273
|
const hasExistingPanel = existingPanel > -1;
|
|
3273
3274
|
this.tabsContainer.openPanel(panel, index);
|
|
3274
|
-
|
|
3275
|
+
if (!skipSetActive) {
|
|
3276
|
+
this.contentContainer.openPanel(panel);
|
|
3277
|
+
}
|
|
3275
3278
|
this.tabsContainer.show();
|
|
3276
3279
|
this.contentContainer.show();
|
|
3277
3280
|
if (hasExistingPanel) {
|
|
@@ -3337,7 +3340,11 @@
|
|
|
3337
3340
|
canDisplayOverlay(event, target) {
|
|
3338
3341
|
// custom overlay handler
|
|
3339
3342
|
if (this.accessor.options.showDndOverlay) {
|
|
3340
|
-
return this.accessor.options.showDndOverlay(
|
|
3343
|
+
return this.accessor.options.showDndOverlay({
|
|
3344
|
+
nativeEvent: event,
|
|
3345
|
+
target,
|
|
3346
|
+
group: this.accessor.getPanel(this.id),
|
|
3347
|
+
});
|
|
3341
3348
|
}
|
|
3342
3349
|
return false;
|
|
3343
3350
|
}
|
|
@@ -3420,7 +3427,7 @@
|
|
|
3420
3427
|
this.element.appendChild(this.gridview.element);
|
|
3421
3428
|
this.layout(0, 0, true); // set some elements height/widths
|
|
3422
3429
|
this.addDisposables(this.gridview.onDidChange(() => {
|
|
3423
|
-
this.
|
|
3430
|
+
this._bufferOnDidLayoutChange.fire();
|
|
3424
3431
|
}));
|
|
3425
3432
|
this.addDisposables(exports.Event.any(this.onDidAddGroup, this.onDidRemoveGroup, this.onDidActiveGroupChange)(() => {
|
|
3426
3433
|
this._bufferOnDidLayoutChange.fire();
|
|
@@ -3581,10 +3588,10 @@
|
|
|
3581
3588
|
this._isVisible = true;
|
|
3582
3589
|
this._width = 0;
|
|
3583
3590
|
this._height = 0;
|
|
3584
|
-
this.
|
|
3591
|
+
this._onDidDimensionChange = new Emitter({
|
|
3585
3592
|
replay: true,
|
|
3586
3593
|
});
|
|
3587
|
-
this.onDidDimensionsChange = this.
|
|
3594
|
+
this.onDidDimensionsChange = this._onDidDimensionChange.event;
|
|
3588
3595
|
//
|
|
3589
3596
|
this._onDidChangeFocus = new Emitter({
|
|
3590
3597
|
replay: true,
|
|
@@ -3609,7 +3616,7 @@
|
|
|
3609
3616
|
//
|
|
3610
3617
|
this._onActiveChange = new Emitter();
|
|
3611
3618
|
this.onActiveChange = this._onActiveChange.event;
|
|
3612
|
-
this.addDisposables(this.
|
|
3619
|
+
this.addDisposables(this._onDidDimensionChange, this._onDidChangeFocus, this._onDidVisibilityChange, this._onDidActiveChange, this._onFocusEvent, this._onActiveChange, this._onVisibilityChange, this.onDidFocusChange((event) => {
|
|
3613
3620
|
this._isFocused = event.isFocused;
|
|
3614
3621
|
}), this.onDidActiveChange((event) => {
|
|
3615
3622
|
this._isActive = event.isActive;
|
|
@@ -3833,7 +3840,7 @@
|
|
|
3833
3840
|
layout(width, height) {
|
|
3834
3841
|
var _a;
|
|
3835
3842
|
// the obtain the correct dimensions of the content panel we must deduct the tab height
|
|
3836
|
-
this.api.
|
|
3843
|
+
this.api._onDidDimensionChange.fire({
|
|
3837
3844
|
width,
|
|
3838
3845
|
height: height - (this.group.model.header.height || 0),
|
|
3839
3846
|
});
|
|
@@ -3930,34 +3937,6 @@
|
|
|
3930
3937
|
}
|
|
3931
3938
|
}
|
|
3932
3939
|
|
|
3933
|
-
class DefaultDeserializer {
|
|
3934
|
-
constructor(layout, panelDeserializer) {
|
|
3935
|
-
this.layout = layout;
|
|
3936
|
-
this.panelDeserializer = panelDeserializer;
|
|
3937
|
-
}
|
|
3938
|
-
fromJSON(node) {
|
|
3939
|
-
const data = node.data;
|
|
3940
|
-
const children = data.views;
|
|
3941
|
-
const active = data.activeView;
|
|
3942
|
-
const group = this.layout.createGroup({
|
|
3943
|
-
id: data.id,
|
|
3944
|
-
locked: !!data.locked,
|
|
3945
|
-
hideHeader: !!data.hideHeader,
|
|
3946
|
-
});
|
|
3947
|
-
for (const child of children) {
|
|
3948
|
-
const panel = this.panelDeserializer.createPanel(child, group);
|
|
3949
|
-
const isActive = typeof active === 'string' && active === panel.id;
|
|
3950
|
-
group.model.openPanel(panel, {
|
|
3951
|
-
skipSetActive: !isActive,
|
|
3952
|
-
});
|
|
3953
|
-
}
|
|
3954
|
-
if (!group.activePanel && group.panels.length > 0) {
|
|
3955
|
-
group.model.openPanel(group.panels[group.panels.length - 1]);
|
|
3956
|
-
}
|
|
3957
|
-
return group;
|
|
3958
|
-
}
|
|
3959
|
-
}
|
|
3960
|
-
|
|
3961
3940
|
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
3962
3941
|
const Component = typeof componentName === 'string'
|
|
3963
3942
|
? components[componentName]
|
|
@@ -3983,53 +3962,6 @@
|
|
|
3983
3962
|
return new Component(id, componentName);
|
|
3984
3963
|
}
|
|
3985
3964
|
|
|
3986
|
-
class WrappedTab {
|
|
3987
|
-
constructor(renderer) {
|
|
3988
|
-
this.renderer = renderer;
|
|
3989
|
-
this._element = document.createElement('element');
|
|
3990
|
-
this.show();
|
|
3991
|
-
}
|
|
3992
|
-
get innerRenderer() {
|
|
3993
|
-
return this.renderer;
|
|
3994
|
-
}
|
|
3995
|
-
get element() {
|
|
3996
|
-
return this._element;
|
|
3997
|
-
}
|
|
3998
|
-
get id() {
|
|
3999
|
-
return this.renderer.id;
|
|
4000
|
-
}
|
|
4001
|
-
show() {
|
|
4002
|
-
if (!this.renderer.element.parentElement) {
|
|
4003
|
-
this._element.appendChild(this.renderer.element);
|
|
4004
|
-
}
|
|
4005
|
-
}
|
|
4006
|
-
hide() {
|
|
4007
|
-
if (this.renderer.element.parentElement) {
|
|
4008
|
-
this.renderer.element.remove();
|
|
4009
|
-
}
|
|
4010
|
-
}
|
|
4011
|
-
layout(width, height) {
|
|
4012
|
-
this.renderer.layout(width, height);
|
|
4013
|
-
}
|
|
4014
|
-
update(event) {
|
|
4015
|
-
this.renderer.update(event);
|
|
4016
|
-
}
|
|
4017
|
-
toJSON() {
|
|
4018
|
-
return this.renderer.toJSON();
|
|
4019
|
-
}
|
|
4020
|
-
focus() {
|
|
4021
|
-
this.renderer.focus();
|
|
4022
|
-
}
|
|
4023
|
-
init(parameters) {
|
|
4024
|
-
this.renderer.init(parameters);
|
|
4025
|
-
}
|
|
4026
|
-
updateParentGroup(group, isPanelVisible) {
|
|
4027
|
-
this.renderer.updateParentGroup(group, isPanelVisible);
|
|
4028
|
-
}
|
|
4029
|
-
dispose() {
|
|
4030
|
-
this.renderer.dispose();
|
|
4031
|
-
}
|
|
4032
|
-
}
|
|
4033
3965
|
class DefaultTab extends CompositeDisposable {
|
|
4034
3966
|
constructor() {
|
|
4035
3967
|
super();
|
|
@@ -4092,15 +4024,21 @@
|
|
|
4092
4024
|
}
|
|
4093
4025
|
}
|
|
4094
4026
|
updateParentGroup(group, isPanelVisible) {
|
|
4027
|
+
const changed = this._isPanelVisible !== isPanelVisible ||
|
|
4028
|
+
this._isGroupActive !== group.isActive;
|
|
4095
4029
|
this._isPanelVisible = isPanelVisible;
|
|
4096
4030
|
this._isGroupActive = group.isActive;
|
|
4097
|
-
|
|
4031
|
+
if (changed) {
|
|
4032
|
+
this.render();
|
|
4033
|
+
}
|
|
4098
4034
|
}
|
|
4099
4035
|
layout(_width, _height) {
|
|
4100
4036
|
// noop
|
|
4101
4037
|
}
|
|
4102
4038
|
render() {
|
|
4103
|
-
this._content.textContent
|
|
4039
|
+
if (this._content.textContent !== this.params.title) {
|
|
4040
|
+
this._content.textContent = this.params.title;
|
|
4041
|
+
}
|
|
4104
4042
|
}
|
|
4105
4043
|
}
|
|
4106
4044
|
|
|
@@ -4144,7 +4082,7 @@
|
|
|
4144
4082
|
layout(width, height) {
|
|
4145
4083
|
this._width = width;
|
|
4146
4084
|
this._height = height;
|
|
4147
|
-
this.api.
|
|
4085
|
+
this.api._onDidDimensionChange.fire({ width, height });
|
|
4148
4086
|
if (this.part) {
|
|
4149
4087
|
if (this._params) {
|
|
4150
4088
|
this.part.update(this._params.params);
|
|
@@ -4193,11 +4131,11 @@
|
|
|
4193
4131
|
this.onDidChange = this._onDidChange.event;
|
|
4194
4132
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
4195
4133
|
const { isVisible } = event;
|
|
4196
|
-
const {
|
|
4197
|
-
|
|
4134
|
+
const { accessor } = this._params;
|
|
4135
|
+
accessor.setVisible(this, isVisible);
|
|
4198
4136
|
}), this.api.onActiveChange(() => {
|
|
4199
|
-
const {
|
|
4200
|
-
|
|
4137
|
+
const { accessor } = this._params;
|
|
4138
|
+
accessor.setActive(this);
|
|
4201
4139
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
4202
4140
|
if (typeof event.minimumWidth === 'number' ||
|
|
4203
4141
|
typeof event.minimumWidth === 'function') {
|
|
@@ -4376,7 +4314,7 @@
|
|
|
4376
4314
|
constructor(renderers) {
|
|
4377
4315
|
var _a;
|
|
4378
4316
|
this._content = renderers.content;
|
|
4379
|
-
this._tab =
|
|
4317
|
+
this._tab = (_a = renderers.tab) !== null && _a !== void 0 ? _a : new DefaultTab();
|
|
4380
4318
|
this._actions =
|
|
4381
4319
|
renderers.actions ||
|
|
4382
4320
|
(this.content.actions
|
|
@@ -4416,9 +4354,7 @@
|
|
|
4416
4354
|
toJSON() {
|
|
4417
4355
|
return {
|
|
4418
4356
|
content: this.content.toJSON(),
|
|
4419
|
-
tab: this.tab
|
|
4420
|
-
? undefined
|
|
4421
|
-
: this.tab.toJSON(),
|
|
4357
|
+
tab: this.tab instanceof DefaultTab ? undefined : this.tab.toJSON(),
|
|
4422
4358
|
};
|
|
4423
4359
|
}
|
|
4424
4360
|
dispose() {
|
|
@@ -4437,9 +4373,6 @@
|
|
|
4437
4373
|
orientation: options.orientation || exports.Orientation.HORIZONTAL,
|
|
4438
4374
|
styles: options.styles,
|
|
4439
4375
|
});
|
|
4440
|
-
// events
|
|
4441
|
-
this._onTabInteractionEvent = new Emitter();
|
|
4442
|
-
this.onTabInteractionEvent = this._onTabInteractionEvent.event;
|
|
4443
4376
|
this._onTabContextMenu = new Emitter();
|
|
4444
4377
|
this.onTabContextMenu = this._onTabContextMenu.event;
|
|
4445
4378
|
this._onDidDrop = new Emitter();
|
|
@@ -4448,11 +4381,11 @@
|
|
|
4448
4381
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
4449
4382
|
this._onDidAddPanel = new Emitter();
|
|
4450
4383
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
4451
|
-
this.
|
|
4452
|
-
this.
|
|
4384
|
+
this._onDidLayoutFromJSON = new Emitter();
|
|
4385
|
+
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
4453
4386
|
this._onDidActivePanelChange = new Emitter();
|
|
4454
4387
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
4455
|
-
this.addDisposables(this.
|
|
4388
|
+
this.addDisposables(this._onTabContextMenu, this._onDidDrop, exports.Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidActivePanelChange)(() => {
|
|
4456
4389
|
this._bufferOnDidLayoutChange.fire();
|
|
4457
4390
|
}));
|
|
4458
4391
|
this._options = options;
|
|
@@ -4507,7 +4440,7 @@
|
|
|
4507
4440
|
}
|
|
4508
4441
|
updateOptions(options) {
|
|
4509
4442
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4510
|
-
this.
|
|
4443
|
+
this.gridview.orientation !== options.orientation;
|
|
4511
4444
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4512
4445
|
if (hasOrientationChanged) {
|
|
4513
4446
|
this.gridview.orientation = options.orientation;
|
|
@@ -4585,12 +4518,7 @@
|
|
|
4585
4518
|
};
|
|
4586
4519
|
}
|
|
4587
4520
|
fromJSON(data) {
|
|
4588
|
-
|
|
4589
|
-
for (const group of groups) {
|
|
4590
|
-
// remove the group will automatically remove the panels
|
|
4591
|
-
this.removeGroup(group, true);
|
|
4592
|
-
}
|
|
4593
|
-
this.gridview.clear();
|
|
4521
|
+
this.clear();
|
|
4594
4522
|
if (!this.deserializer) {
|
|
4595
4523
|
throw new Error('invalid deserializer');
|
|
4596
4524
|
}
|
|
@@ -4601,12 +4529,31 @@
|
|
|
4601
4529
|
if (!this.deserializer) {
|
|
4602
4530
|
throw new Error('no deserializer provided');
|
|
4603
4531
|
}
|
|
4604
|
-
this.gridview.deserialize(grid,
|
|
4605
|
-
|
|
4606
|
-
const
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4532
|
+
this.gridview.deserialize(grid, {
|
|
4533
|
+
fromJSON: (node) => {
|
|
4534
|
+
const { id, locked, hideHeader, views, activeView } = node.data;
|
|
4535
|
+
const group = this.createGroup({
|
|
4536
|
+
id,
|
|
4537
|
+
locked: !!locked,
|
|
4538
|
+
hideHeader: !!hideHeader,
|
|
4539
|
+
});
|
|
4540
|
+
this._onDidAddGroup.fire(group);
|
|
4541
|
+
for (const child of views) {
|
|
4542
|
+
const panel = this.deserializer.fromJSON(panels[child], group);
|
|
4543
|
+
const isActive = typeof activeView === 'string' && activeView === panel.id;
|
|
4544
|
+
group.model.openPanel(panel, {
|
|
4545
|
+
skipSetPanelActive: !isActive,
|
|
4546
|
+
skipSetGroupActive: true
|
|
4547
|
+
});
|
|
4548
|
+
}
|
|
4549
|
+
if (!group.activePanel && group.panels.length > 0) {
|
|
4550
|
+
group.model.openPanel(group.panels[group.panels.length - 1], {
|
|
4551
|
+
skipSetGroupActive: true
|
|
4552
|
+
});
|
|
4553
|
+
}
|
|
4554
|
+
return group;
|
|
4555
|
+
}
|
|
4556
|
+
});
|
|
4610
4557
|
if (typeof activeGroup === 'string') {
|
|
4611
4558
|
const panel = this.getPanel(activeGroup);
|
|
4612
4559
|
if (panel) {
|
|
@@ -4614,7 +4561,23 @@
|
|
|
4614
4561
|
}
|
|
4615
4562
|
}
|
|
4616
4563
|
this.gridview.layout(this.width, this.height);
|
|
4617
|
-
this.
|
|
4564
|
+
this._onDidLayoutFromJSON.fire();
|
|
4565
|
+
}
|
|
4566
|
+
clear() {
|
|
4567
|
+
const groups = Array.from(this._groups.values()).map((_) => _.value);
|
|
4568
|
+
const hasActiveGroup = !!this.activeGroup;
|
|
4569
|
+
const hasActivePanel = !!this.activePanel;
|
|
4570
|
+
for (const group of groups) {
|
|
4571
|
+
// remove the group will automatically remove the panels
|
|
4572
|
+
this.removeGroup(group, true);
|
|
4573
|
+
}
|
|
4574
|
+
if (hasActiveGroup) {
|
|
4575
|
+
this.doSetGroupActive(undefined);
|
|
4576
|
+
}
|
|
4577
|
+
if (hasActivePanel) {
|
|
4578
|
+
this._onDidActivePanelChange.fire(undefined);
|
|
4579
|
+
}
|
|
4580
|
+
this.gridview.clear();
|
|
4618
4581
|
}
|
|
4619
4582
|
closeAllGroups() {
|
|
4620
4583
|
for (const entry of this._groups.entries()) {
|
|
@@ -4806,13 +4769,13 @@
|
|
|
4806
4769
|
}
|
|
4807
4770
|
}
|
|
4808
4771
|
const view = new GroupPanel(this, id, options);
|
|
4809
|
-
view.init({ params: {},
|
|
4772
|
+
view.init({ params: {}, accessor: null }); // required to initialized .part and allow for correct disposal of group
|
|
4810
4773
|
if (!this._groups.has(view.id)) {
|
|
4811
4774
|
const disposable = new CompositeDisposable(view.model.onMove((event) => {
|
|
4812
4775
|
const { groupId, itemId, target, index } = event;
|
|
4813
4776
|
this.moveGroupOrPanel(view, groupId, itemId, target, index);
|
|
4814
4777
|
}), view.model.onDidDrop((event) => {
|
|
4815
|
-
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api }));
|
|
4778
|
+
this._onDidDrop.fire(Object.assign(Object.assign({}, event), { api: this._api, group: view }));
|
|
4816
4779
|
}), view.model.onDidGroupChange((event) => {
|
|
4817
4780
|
switch (event.kind) {
|
|
4818
4781
|
case exports.GroupChangeKind2.ADD_PANEL:
|
|
@@ -4876,7 +4839,7 @@
|
|
|
4876
4839
|
this._onDidActivePanelChange.dispose();
|
|
4877
4840
|
this._onDidAddPanel.dispose();
|
|
4878
4841
|
this._onDidRemovePanel.dispose();
|
|
4879
|
-
this.
|
|
4842
|
+
this._onDidLayoutFromJSON.dispose();
|
|
4880
4843
|
}
|
|
4881
4844
|
}
|
|
4882
4845
|
|
|
@@ -4914,7 +4877,7 @@
|
|
|
4914
4877
|
}
|
|
4915
4878
|
updateOptions(options) {
|
|
4916
4879
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
4917
|
-
this.
|
|
4880
|
+
this.gridview.orientation !== options.orientation;
|
|
4918
4881
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
4919
4882
|
if (hasOrientationChanged) {
|
|
4920
4883
|
this.gridview.orientation = options.orientation;
|
|
@@ -4945,21 +4908,13 @@
|
|
|
4945
4908
|
value.value.setActive(panel === value.value);
|
|
4946
4909
|
});
|
|
4947
4910
|
}
|
|
4948
|
-
toggleVisibility(panel) {
|
|
4949
|
-
this.setVisible(panel, !this.isVisible(panel));
|
|
4950
|
-
}
|
|
4951
4911
|
focus() {
|
|
4952
4912
|
var _a;
|
|
4953
4913
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4954
4914
|
}
|
|
4955
4915
|
fromJSON(serializedGridview) {
|
|
4916
|
+
this.clear();
|
|
4956
4917
|
const { grid, activePanel } = serializedGridview;
|
|
4957
|
-
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
4958
|
-
for (const group of groups) {
|
|
4959
|
-
group.disposable.dispose();
|
|
4960
|
-
this.doRemoveGroup(group.value, { skipActive: true });
|
|
4961
|
-
}
|
|
4962
|
-
this.gridview.clear();
|
|
4963
4918
|
const queue = [];
|
|
4964
4919
|
this.gridview.deserialize(grid, {
|
|
4965
4920
|
fromJSON: (node) => {
|
|
@@ -4978,9 +4933,10 @@
|
|
|
4978
4933
|
maximumHeight: data.maximumHeight,
|
|
4979
4934
|
priority: data.priority,
|
|
4980
4935
|
snap: !!data.snap,
|
|
4981
|
-
|
|
4936
|
+
accessor: this,
|
|
4982
4937
|
isVisible: node.visible,
|
|
4983
4938
|
}));
|
|
4939
|
+
this._onDidAddGroup.fire(view);
|
|
4984
4940
|
this.registerPanel(view);
|
|
4985
4941
|
return view;
|
|
4986
4942
|
},
|
|
@@ -4995,6 +4951,18 @@
|
|
|
4995
4951
|
}
|
|
4996
4952
|
this._onDidLayoutfromJSON.fire();
|
|
4997
4953
|
}
|
|
4954
|
+
clear() {
|
|
4955
|
+
const hasActiveGroup = this.activeGroup;
|
|
4956
|
+
const groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
4957
|
+
for (const group of groups) {
|
|
4958
|
+
group.disposable.dispose();
|
|
4959
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
4960
|
+
}
|
|
4961
|
+
if (hasActiveGroup) {
|
|
4962
|
+
this.doSetGroupActive(undefined);
|
|
4963
|
+
}
|
|
4964
|
+
this.gridview.clear();
|
|
4965
|
+
}
|
|
4998
4966
|
movePanel(panel, options) {
|
|
4999
4967
|
var _a;
|
|
5000
4968
|
let relativeLocation;
|
|
@@ -5044,7 +5012,7 @@
|
|
|
5044
5012
|
maximumHeight: options.maximumHeight,
|
|
5045
5013
|
priority: options.priority,
|
|
5046
5014
|
snap: !!options.snap,
|
|
5047
|
-
|
|
5015
|
+
accessor: this,
|
|
5048
5016
|
isVisible: true,
|
|
5049
5017
|
});
|
|
5050
5018
|
this.registerPanel(view);
|
|
@@ -5240,7 +5208,7 @@
|
|
|
5240
5208
|
maximumSize: options.maximumSize,
|
|
5241
5209
|
snap: options.snap,
|
|
5242
5210
|
priority: options.priority,
|
|
5243
|
-
|
|
5211
|
+
accessor: this,
|
|
5244
5212
|
});
|
|
5245
5213
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
5246
5214
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
@@ -5285,13 +5253,8 @@
|
|
|
5285
5253
|
};
|
|
5286
5254
|
}
|
|
5287
5255
|
fromJSON(serializedSplitview) {
|
|
5256
|
+
this.clear();
|
|
5288
5257
|
const { views, orientation, size, activeView } = serializedSplitview;
|
|
5289
|
-
for (const [_, value] of this._panels.entries()) {
|
|
5290
|
-
value.disposable.dispose();
|
|
5291
|
-
value.value.dispose();
|
|
5292
|
-
}
|
|
5293
|
-
this._panels.clear();
|
|
5294
|
-
this.splitview.dispose();
|
|
5295
5258
|
const queue = [];
|
|
5296
5259
|
this.splitview = new Splitview(this.element, {
|
|
5297
5260
|
orientation,
|
|
@@ -5316,7 +5279,7 @@
|
|
|
5316
5279
|
maximumSize: data.maximumSize,
|
|
5317
5280
|
snap: view.snap,
|
|
5318
5281
|
priority: view.priority,
|
|
5319
|
-
|
|
5282
|
+
accessor: this,
|
|
5320
5283
|
});
|
|
5321
5284
|
});
|
|
5322
5285
|
panel.orientation = orientation;
|
|
@@ -5339,6 +5302,14 @@
|
|
|
5339
5302
|
}
|
|
5340
5303
|
this._onDidLayoutfromJSON.fire();
|
|
5341
5304
|
}
|
|
5305
|
+
clear() {
|
|
5306
|
+
for (const [_, value] of this._panels.entries()) {
|
|
5307
|
+
value.disposable.dispose();
|
|
5308
|
+
value.value.dispose();
|
|
5309
|
+
}
|
|
5310
|
+
this._panels.clear();
|
|
5311
|
+
this.splitview.dispose();
|
|
5312
|
+
}
|
|
5342
5313
|
dispose() {
|
|
5343
5314
|
for (const [_, value] of this._panels.entries()) {
|
|
5344
5315
|
value.disposable.dispose();
|
|
@@ -5667,9 +5638,9 @@
|
|
|
5667
5638
|
this.element.className = 'default-header';
|
|
5668
5639
|
this._content = document.createElement('span');
|
|
5669
5640
|
this._expander = document.createElement('a');
|
|
5670
|
-
this.element.appendChild(this._content);
|
|
5671
5641
|
this.element.appendChild(this._expander);
|
|
5672
|
-
this.
|
|
5642
|
+
this.element.appendChild(this._content);
|
|
5643
|
+
this.addDisposables(addDisposableListener(this._element, 'click', () => {
|
|
5673
5644
|
var _a;
|
|
5674
5645
|
(_a = this.apiRef.api) === null || _a === void 0 ? void 0 : _a.setExpanded(!this.apiRef.api.isExpanded);
|
|
5675
5646
|
}));
|
|
@@ -5680,9 +5651,10 @@
|
|
|
5680
5651
|
init(params) {
|
|
5681
5652
|
this.apiRef.api = params.api;
|
|
5682
5653
|
this._content.textContent = params.title;
|
|
5683
|
-
this._expander.textContent =
|
|
5654
|
+
this._expander.textContent = '▼';
|
|
5655
|
+
toggleClass(this._expander, 'collapsed', !params.api.isExpanded);
|
|
5684
5656
|
this.disposable.value = params.api.onDidExpansionChange((e) => {
|
|
5685
|
-
this._expander
|
|
5657
|
+
toggleClass(this._expander, 'collapsed', !e.isExpanded);
|
|
5686
5658
|
});
|
|
5687
5659
|
}
|
|
5688
5660
|
update(_params) {
|
|
@@ -5858,13 +5830,9 @@
|
|
|
5858
5830
|
};
|
|
5859
5831
|
}
|
|
5860
5832
|
fromJSON(serializedPaneview) {
|
|
5833
|
+
this.clear();
|
|
5861
5834
|
const { views, size } = serializedPaneview;
|
|
5862
5835
|
const queue = [];
|
|
5863
|
-
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5864
|
-
value.dispose();
|
|
5865
|
-
}
|
|
5866
|
-
this._viewDisposables.clear();
|
|
5867
|
-
this.paneview.dispose();
|
|
5868
5836
|
this.paneview = new Paneview(this.element, {
|
|
5869
5837
|
orientation: exports.Orientation.VERTICAL,
|
|
5870
5838
|
descriptor: {
|
|
@@ -5923,6 +5891,13 @@
|
|
|
5923
5891
|
queue.forEach((f) => f());
|
|
5924
5892
|
this._onDidLayoutfromJSON.fire();
|
|
5925
5893
|
}
|
|
5894
|
+
clear() {
|
|
5895
|
+
for (const [_, value] of this._viewDisposables.entries()) {
|
|
5896
|
+
value.dispose();
|
|
5897
|
+
}
|
|
5898
|
+
this._viewDisposables.clear();
|
|
5899
|
+
this.paneview.dispose();
|
|
5900
|
+
}
|
|
5926
5901
|
doAddPanel(panel) {
|
|
5927
5902
|
const disposable = panel.onDidDrop((event) => {
|
|
5928
5903
|
this._onDidDrop.fire(event);
|
|
@@ -5958,13 +5933,11 @@
|
|
|
5958
5933
|
this.onDidChange = this._onDidChange.event;
|
|
5959
5934
|
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
5960
5935
|
const { isVisible } = event;
|
|
5961
|
-
const {
|
|
5962
|
-
|
|
5963
|
-
containerApi.setVisible(this, isVisible);
|
|
5936
|
+
const { accessor } = this._params;
|
|
5937
|
+
accessor.setVisible(this, isVisible);
|
|
5964
5938
|
}), this.api.onActiveChange(() => {
|
|
5965
|
-
const {
|
|
5966
|
-
|
|
5967
|
-
containerApi.setActive(this);
|
|
5939
|
+
const { accessor } = this._params;
|
|
5940
|
+
accessor.setActive(this);
|
|
5968
5941
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
5969
5942
|
if (typeof event.minimumSize === 'number' ||
|
|
5970
5943
|
typeof event.minimumSize === 'function') {
|
|
@@ -6216,9 +6189,6 @@
|
|
|
6216
6189
|
layout(_width, _height) {
|
|
6217
6190
|
// noop
|
|
6218
6191
|
}
|
|
6219
|
-
close() {
|
|
6220
|
-
return Promise.resolve(true);
|
|
6221
|
-
}
|
|
6222
6192
|
dispose() {
|
|
6223
6193
|
var _a, _b;
|
|
6224
6194
|
this._onDidFocus.dispose();
|
|
@@ -6488,58 +6458,6 @@
|
|
|
6488
6458
|
});
|
|
6489
6459
|
DockviewReact.displayName = 'DockviewComponent';
|
|
6490
6460
|
|
|
6491
|
-
const Tab = (props) => {
|
|
6492
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6493
|
-
};
|
|
6494
|
-
const Content = (props) => {
|
|
6495
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6496
|
-
};
|
|
6497
|
-
const Actions = (props) => {
|
|
6498
|
-
return React__namespace.createElement(React__namespace.Fragment, null, props.children);
|
|
6499
|
-
};
|
|
6500
|
-
function isValidComponent(element) {
|
|
6501
|
-
return [Content, Actions, Tab].find((comp) => element.type === comp);
|
|
6502
|
-
}
|
|
6503
|
-
const Panel = (props) => {
|
|
6504
|
-
const context = React__namespace.useContext(ReactPartContext);
|
|
6505
|
-
const sections = React__namespace.useMemo(() => {
|
|
6506
|
-
var _a;
|
|
6507
|
-
const childs = ((_a = React__namespace.Children.map(props.children, (_) => _)) === null || _a === void 0 ? void 0 : _a.filter(isReactElement)) || [];
|
|
6508
|
-
const isInvalid = !!childs.find((_) => !isValidComponent(_));
|
|
6509
|
-
if (isInvalid) {
|
|
6510
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
6511
|
-
}
|
|
6512
|
-
const body = childs.find((_) => _.type === Content);
|
|
6513
|
-
const actions = childs.find((_) => _.type === Actions);
|
|
6514
|
-
const tab = childs.find((_) => _.type === Tab);
|
|
6515
|
-
return { body, actions, tab };
|
|
6516
|
-
}, [props.children]);
|
|
6517
|
-
React__namespace.useEffect(() => {
|
|
6518
|
-
/**
|
|
6519
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
6520
|
-
* with our own React tab.
|
|
6521
|
-
*/
|
|
6522
|
-
if (sections.tab) {
|
|
6523
|
-
context.tabPortalElement.hide();
|
|
6524
|
-
}
|
|
6525
|
-
else {
|
|
6526
|
-
context.tabPortalElement.show();
|
|
6527
|
-
}
|
|
6528
|
-
}, [sections.tab]);
|
|
6529
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
6530
|
-
sections.actions &&
|
|
6531
|
-
ReactDOM__namespace.createPortal(sections.actions, context.actionsPortalElement),
|
|
6532
|
-
sections.tab &&
|
|
6533
|
-
ReactDOM__namespace.createPortal(sections.tab, context.tabPortalElement.element),
|
|
6534
|
-
sections.body || props.children));
|
|
6535
|
-
};
|
|
6536
|
-
const DockviewComponents = {
|
|
6537
|
-
Tab,
|
|
6538
|
-
Content,
|
|
6539
|
-
Actions,
|
|
6540
|
-
Panel,
|
|
6541
|
-
};
|
|
6542
|
-
|
|
6543
6461
|
class ReactPanelView extends SplitviewPanel {
|
|
6544
6462
|
constructor(id, component, reactComponent, reactPortalStore) {
|
|
6545
6463
|
super(id, component);
|
|
@@ -6551,8 +6469,7 @@
|
|
|
6551
6469
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6552
6470
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6553
6471
|
api: this.api,
|
|
6554
|
-
containerApi: this._params
|
|
6555
|
-
.containerApi,
|
|
6472
|
+
containerApi: new SplitviewApi(this._params.accessor),
|
|
6556
6473
|
});
|
|
6557
6474
|
}
|
|
6558
6475
|
}
|
|
@@ -6628,8 +6545,7 @@
|
|
|
6628
6545
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
6629
6546
|
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
6630
6547
|
api: this.api,
|
|
6631
|
-
containerApi: this._params
|
|
6632
|
-
.containerApi,
|
|
6548
|
+
containerApi: new GridviewApi(this._params.accessor),
|
|
6633
6549
|
});
|
|
6634
6550
|
}
|
|
6635
6551
|
}
|
|
@@ -6823,7 +6739,6 @@
|
|
|
6823
6739
|
exports.ContentContainer = ContentContainer;
|
|
6824
6740
|
exports.DockviewApi = DockviewApi;
|
|
6825
6741
|
exports.DockviewComponent = DockviewComponent;
|
|
6826
|
-
exports.DockviewComponents = DockviewComponents;
|
|
6827
6742
|
exports.DockviewReact = DockviewReact;
|
|
6828
6743
|
exports.Gridview = Gridview;
|
|
6829
6744
|
exports.GridviewApi = GridviewApi;
|
|
@@ -6849,7 +6764,7 @@
|
|
|
6849
6764
|
exports.SplitviewComponent = SplitviewComponent;
|
|
6850
6765
|
exports.SplitviewPanel = SplitviewPanel;
|
|
6851
6766
|
exports.SplitviewReact = SplitviewReact;
|
|
6852
|
-
exports.Tab = Tab
|
|
6767
|
+
exports.Tab = Tab;
|
|
6853
6768
|
exports.getDirectionOrientation = getDirectionOrientation;
|
|
6854
6769
|
exports.getGridLocation = getGridLocation;
|
|
6855
6770
|
exports.getLocationOrientation = getLocationOrientation;
|