dockview 2.1.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dockview/dockview.d.ts +0 -1
- package/dist/cjs/dockview/dockview.js +3 -3
- package/dist/cjs/dockview/headerActionsRenderer.js +1 -1
- package/dist/cjs/dockview/reactContentPart.js +1 -1
- package/dist/cjs/dockview/reactHeaderPart.js +1 -1
- package/dist/cjs/dockview/reactWatermarkPart.js +1 -1
- package/dist/cjs/gridview/gridview.d.ts +2 -7
- package/dist/cjs/gridview/gridview.js +47 -20
- package/dist/cjs/paneview/paneview.d.ts +2 -6
- package/dist/cjs/paneview/paneview.js +54 -36
- package/dist/cjs/paneview/view.d.ts +2 -2
- package/dist/cjs/splitview/splitview.d.ts +2 -7
- package/dist/cjs/splitview/splitview.js +52 -20
- package/dist/dockview.amd.js +295 -251
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +295 -251
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +295 -251
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +291 -251
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +295 -251
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +295 -251
- package/dist/dockview.noStyle.js.map +1 -1
- package/dist/esm/dockview/dockview.d.ts +0 -1
- package/dist/esm/dockview/dockview.js +4 -4
- package/dist/esm/dockview/headerActionsRenderer.js +1 -1
- package/dist/esm/dockview/reactContentPart.js +1 -1
- package/dist/esm/dockview/reactHeaderPart.js +1 -1
- package/dist/esm/dockview/reactWatermarkPart.js +1 -1
- package/dist/esm/gridview/gridview.d.ts +2 -7
- package/dist/esm/gridview/gridview.js +36 -20
- package/dist/esm/paneview/paneview.d.ts +2 -6
- package/dist/esm/paneview/paneview.js +53 -33
- package/dist/esm/paneview/view.d.ts +2 -2
- package/dist/esm/splitview/splitview.d.ts +2 -7
- package/dist/esm/splitview/splitview.js +41 -20
- package/package.json +2 -2
package/dist/dockview.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version
|
|
3
|
+
* @version 3.0.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -132,6 +132,17 @@ class DockviewEvent {
|
|
|
132
132
|
this._defaultPrevented = true;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
class AcceptableEvent {
|
|
136
|
+
constructor() {
|
|
137
|
+
this._isAccepted = false;
|
|
138
|
+
}
|
|
139
|
+
get isAccepted() {
|
|
140
|
+
return this._isAccepted;
|
|
141
|
+
}
|
|
142
|
+
accept() {
|
|
143
|
+
this._isAccepted = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
135
146
|
class LeakageMonitor {
|
|
136
147
|
constructor() {
|
|
137
148
|
this.events = new Map();
|
|
@@ -1523,6 +1534,23 @@ class Splitview {
|
|
|
1523
1534
|
}
|
|
1524
1535
|
}
|
|
1525
1536
|
|
|
1537
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1538
|
+
/**
|
|
1539
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1540
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1541
|
+
*/
|
|
1542
|
+
const properties = {
|
|
1543
|
+
orientation: undefined,
|
|
1544
|
+
descriptor: undefined,
|
|
1545
|
+
proportionalLayout: undefined,
|
|
1546
|
+
styles: undefined,
|
|
1547
|
+
margin: undefined,
|
|
1548
|
+
disableAutoResizing: undefined,
|
|
1549
|
+
className: undefined,
|
|
1550
|
+
};
|
|
1551
|
+
return Object.keys(properties);
|
|
1552
|
+
})();
|
|
1553
|
+
|
|
1526
1554
|
class Paneview extends CompositeDisposable {
|
|
1527
1555
|
get onDidAddView() {
|
|
1528
1556
|
return this.splitview.onDidAddView;
|
|
@@ -2652,6 +2680,21 @@ class Gridview {
|
|
|
2652
2680
|
}
|
|
2653
2681
|
}
|
|
2654
2682
|
|
|
2683
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2684
|
+
/**
|
|
2685
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2686
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2687
|
+
*/
|
|
2688
|
+
const properties = {
|
|
2689
|
+
disableAutoResizing: undefined,
|
|
2690
|
+
proportionalLayout: undefined,
|
|
2691
|
+
orientation: undefined,
|
|
2692
|
+
hideBorders: undefined,
|
|
2693
|
+
className: undefined,
|
|
2694
|
+
};
|
|
2695
|
+
return Object.keys(properties);
|
|
2696
|
+
})();
|
|
2697
|
+
|
|
2655
2698
|
class Resizable extends CompositeDisposable {
|
|
2656
2699
|
get element() {
|
|
2657
2700
|
return this._element;
|
|
@@ -3129,15 +3172,10 @@ class PaneviewApi {
|
|
|
3129
3172
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3130
3173
|
*/
|
|
3131
3174
|
get onDidDrop() {
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
emitter.dispose = () => {
|
|
3137
|
-
disposable.dispose();
|
|
3138
|
-
emitter.dispose();
|
|
3139
|
-
};
|
|
3140
|
-
return emitter.event;
|
|
3175
|
+
return this.component.onDidDrop;
|
|
3176
|
+
}
|
|
3177
|
+
get onUnhandledDragOverEvent() {
|
|
3178
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3141
3179
|
}
|
|
3142
3180
|
constructor(component) {
|
|
3143
3181
|
this.component = component;
|
|
@@ -4064,6 +4102,28 @@ function calculateQuadrantAsPixels(overlayType, x, y, width, height, threshold)
|
|
|
4064
4102
|
return 'center';
|
|
4065
4103
|
}
|
|
4066
4104
|
|
|
4105
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4106
|
+
/**
|
|
4107
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4108
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4109
|
+
*/
|
|
4110
|
+
const properties = {
|
|
4111
|
+
disableAutoResizing: undefined,
|
|
4112
|
+
disableDnd: undefined,
|
|
4113
|
+
className: undefined,
|
|
4114
|
+
};
|
|
4115
|
+
return Object.keys(properties);
|
|
4116
|
+
})();
|
|
4117
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4118
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4119
|
+
super();
|
|
4120
|
+
this.nativeEvent = nativeEvent;
|
|
4121
|
+
this.position = position;
|
|
4122
|
+
this.getData = getData;
|
|
4123
|
+
this.panel = panel;
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4067
4127
|
class WillFocusEvent extends DockviewEvent {
|
|
4068
4128
|
constructor() {
|
|
4069
4129
|
super();
|
|
@@ -4487,6 +4547,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4487
4547
|
this.accessor = accessor;
|
|
4488
4548
|
this._onDidDrop = new Emitter();
|
|
4489
4549
|
this.onDidDrop = this._onDidDrop.event;
|
|
4550
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4551
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4552
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4490
4553
|
if (!disableDnd) {
|
|
4491
4554
|
this.initDragFeatures();
|
|
4492
4555
|
}
|
|
@@ -4513,7 +4576,7 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4513
4576
|
overlayModel: {
|
|
4514
4577
|
activationSize: { type: 'percentage', value: 50 },
|
|
4515
4578
|
},
|
|
4516
|
-
canDisplayOverlay: (event) => {
|
|
4579
|
+
canDisplayOverlay: (event, position) => {
|
|
4517
4580
|
const data = getPaneData();
|
|
4518
4581
|
if (data) {
|
|
4519
4582
|
if (data.paneId !== this.id &&
|
|
@@ -4521,14 +4584,9 @@ class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
4521
4584
|
return true;
|
|
4522
4585
|
}
|
|
4523
4586
|
}
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
getData: getPaneData,
|
|
4528
|
-
panel: this,
|
|
4529
|
-
});
|
|
4530
|
-
}
|
|
4531
|
-
return false;
|
|
4587
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4588
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4589
|
+
return firedEvent.isAccepted;
|
|
4532
4590
|
},
|
|
4533
4591
|
});
|
|
4534
4592
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4983,15 +5041,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
4983
5041
|
this._element.appendChild(this.leftActionsContainer);
|
|
4984
5042
|
this._element.appendChild(this.voidContainer.element);
|
|
4985
5043
|
this._element.appendChild(this.rightActionsContainer);
|
|
4986
|
-
this.addDisposables(this.
|
|
4987
|
-
if (e.api.group === this.group) {
|
|
4988
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4989
|
-
}
|
|
4990
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4991
|
-
if (e.api.group === this.group) {
|
|
4992
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4993
|
-
}
|
|
4994
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5044
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4995
5045
|
this._onGroupDragStart.fire({
|
|
4996
5046
|
nativeEvent: event,
|
|
4997
5047
|
group: this.group,
|
|
@@ -5036,20 +5086,6 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5036
5086
|
setActive(_isGroupActive) {
|
|
5037
5087
|
// noop
|
|
5038
5088
|
}
|
|
5039
|
-
addTab(tab, index = this.tabs.length) {
|
|
5040
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5041
|
-
throw new Error('invalid location');
|
|
5042
|
-
}
|
|
5043
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5044
|
-
this.tabs = [
|
|
5045
|
-
...this.tabs.slice(0, index),
|
|
5046
|
-
tab,
|
|
5047
|
-
...this.tabs.slice(index),
|
|
5048
|
-
];
|
|
5049
|
-
if (this.selectedIndex < 0) {
|
|
5050
|
-
this.selectedIndex = index;
|
|
5051
|
-
}
|
|
5052
|
-
}
|
|
5053
5089
|
delete(id) {
|
|
5054
5090
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5055
5091
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5057,6 +5093,7 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5057
5093
|
disposable.dispose();
|
|
5058
5094
|
value.dispose();
|
|
5059
5095
|
value.element.remove();
|
|
5096
|
+
this.updateClassnames();
|
|
5060
5097
|
}
|
|
5061
5098
|
setActivePanel(panel) {
|
|
5062
5099
|
this.tabs.forEach((tab) => {
|
|
@@ -5125,25 +5162,37 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5125
5162
|
}
|
|
5126
5163
|
this.tabs = [];
|
|
5127
5164
|
}
|
|
5165
|
+
addTab(tab, index = this.tabs.length) {
|
|
5166
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5167
|
+
throw new Error('invalid location');
|
|
5168
|
+
}
|
|
5169
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5170
|
+
this.tabs = [
|
|
5171
|
+
...this.tabs.slice(0, index),
|
|
5172
|
+
tab,
|
|
5173
|
+
...this.tabs.slice(index),
|
|
5174
|
+
];
|
|
5175
|
+
if (this.selectedIndex < 0) {
|
|
5176
|
+
this.selectedIndex = index;
|
|
5177
|
+
}
|
|
5178
|
+
this.updateClassnames();
|
|
5179
|
+
}
|
|
5180
|
+
updateClassnames() {
|
|
5181
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5182
|
+
}
|
|
5128
5183
|
}
|
|
5129
5184
|
|
|
5130
|
-
class DockviewUnhandledDragOverEvent {
|
|
5131
|
-
get isAccepted() {
|
|
5132
|
-
return this._isAccepted;
|
|
5133
|
-
}
|
|
5185
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5134
5186
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5187
|
+
super();
|
|
5135
5188
|
this.nativeEvent = nativeEvent;
|
|
5136
5189
|
this.target = target;
|
|
5137
5190
|
this.position = position;
|
|
5138
5191
|
this.getData = getData;
|
|
5139
5192
|
this.group = group;
|
|
5140
|
-
this._isAccepted = false;
|
|
5141
|
-
}
|
|
5142
|
-
accept() {
|
|
5143
|
-
this._isAccepted = true;
|
|
5144
5193
|
}
|
|
5145
5194
|
}
|
|
5146
|
-
const
|
|
5195
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5147
5196
|
/**
|
|
5148
5197
|
* by readong the keys from an empty value object TypeScript will error
|
|
5149
5198
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -7643,10 +7692,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
7643
7692
|
this._api = new DockviewApi(this);
|
|
7644
7693
|
this.updateWatermark();
|
|
7645
7694
|
}
|
|
7646
|
-
dispose() {
|
|
7647
|
-
this.clear(); // explicitly clear the layout before cleaning up
|
|
7648
|
-
super.dispose();
|
|
7649
|
-
}
|
|
7650
7695
|
setVisible(panel, visible) {
|
|
7651
7696
|
switch (panel.api.location.type) {
|
|
7652
7697
|
case 'grid':
|
|
@@ -7830,30 +7875,29 @@ class DockviewComponent extends BaseGrid {
|
|
|
7830
7875
|
}
|
|
7831
7876
|
}
|
|
7832
7877
|
else if (this.getPanel(group.id)) {
|
|
7833
|
-
|
|
7878
|
+
group.model.renderContainer =
|
|
7879
|
+
this.overlayRenderContainer;
|
|
7880
|
+
returnedGroup = group;
|
|
7834
7881
|
if (floatingBox) {
|
|
7835
|
-
this.addFloatingGroup(
|
|
7882
|
+
this.addFloatingGroup(group, {
|
|
7836
7883
|
height: floatingBox.height,
|
|
7837
7884
|
width: floatingBox.width,
|
|
7838
7885
|
position: floatingBox,
|
|
7839
7886
|
});
|
|
7840
7887
|
}
|
|
7841
7888
|
else {
|
|
7842
|
-
this.doRemoveGroup(
|
|
7889
|
+
this.doRemoveGroup(group, {
|
|
7843
7890
|
skipDispose: true,
|
|
7844
7891
|
skipActive: true,
|
|
7845
7892
|
skipPopoutReturn: true,
|
|
7846
7893
|
});
|
|
7847
|
-
|
|
7848
|
-
this.overlayRenderContainer;
|
|
7849
|
-
removedGroup.model.location = { type: 'grid' };
|
|
7850
|
-
returnedGroup = removedGroup;
|
|
7894
|
+
group.model.location = { type: 'grid' };
|
|
7851
7895
|
this.movingLock(() => {
|
|
7852
7896
|
// suppress group add events since the group already exists
|
|
7853
|
-
this.doAddGroup(
|
|
7897
|
+
this.doAddGroup(group, [0]);
|
|
7854
7898
|
});
|
|
7855
7899
|
}
|
|
7856
|
-
this.doSetGroupAndPanelActive(
|
|
7900
|
+
this.doSetGroupAndPanelActive(group);
|
|
7857
7901
|
}
|
|
7858
7902
|
}));
|
|
7859
7903
|
this._popoutGroups.push(value);
|
|
@@ -8994,31 +9038,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
8994
9038
|
}
|
|
8995
9039
|
}
|
|
8996
9040
|
|
|
8997
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8998
|
-
const Component = typeof componentName === 'string'
|
|
8999
|
-
? components[componentName]
|
|
9000
|
-
: undefined;
|
|
9001
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
9002
|
-
? frameworkComponents[componentName]
|
|
9003
|
-
: undefined;
|
|
9004
|
-
if (Component && FrameworkComponent) {
|
|
9005
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
9006
|
-
}
|
|
9007
|
-
if (FrameworkComponent) {
|
|
9008
|
-
if (!createFrameworkComponent) {
|
|
9009
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9010
|
-
}
|
|
9011
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9012
|
-
}
|
|
9013
|
-
if (!Component) {
|
|
9014
|
-
if (fallback) {
|
|
9015
|
-
return fallback();
|
|
9016
|
-
}
|
|
9017
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9018
|
-
}
|
|
9019
|
-
return new Component(id, componentName);
|
|
9020
|
-
}
|
|
9021
|
-
|
|
9022
9041
|
class GridviewComponent extends BaseGrid {
|
|
9023
9042
|
get orientation() {
|
|
9024
9043
|
return this.gridview.orientation;
|
|
@@ -9036,10 +9055,13 @@ class GridviewComponent extends BaseGrid {
|
|
|
9036
9055
|
this._deserializer = value;
|
|
9037
9056
|
}
|
|
9038
9057
|
constructor(parentElement, options) {
|
|
9058
|
+
var _a;
|
|
9039
9059
|
super(parentElement, {
|
|
9040
|
-
proportionalLayout: options.proportionalLayout,
|
|
9060
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9041
9061
|
orientation: options.orientation,
|
|
9042
|
-
styles: options.
|
|
9062
|
+
styles: options.hideBorders
|
|
9063
|
+
? { separatorBorder: 'transparent' }
|
|
9064
|
+
: undefined,
|
|
9043
9065
|
disableAutoResizing: options.disableAutoResizing,
|
|
9044
9066
|
className: options.className,
|
|
9045
9067
|
});
|
|
@@ -9059,12 +9081,6 @@ class GridviewComponent extends BaseGrid {
|
|
|
9059
9081
|
}), this.onDidActiveChange((event) => {
|
|
9060
9082
|
this._onDidActiveGroupChange.fire(event);
|
|
9061
9083
|
}));
|
|
9062
|
-
if (!this.options.components) {
|
|
9063
|
-
this.options.components = {};
|
|
9064
|
-
}
|
|
9065
|
-
if (!this.options.frameworkComponents) {
|
|
9066
|
-
this.options.frameworkComponents = {};
|
|
9067
|
-
}
|
|
9068
9084
|
}
|
|
9069
9085
|
updateOptions(options) {
|
|
9070
9086
|
super.updateOptions(options);
|
|
@@ -9114,14 +9130,11 @@ class GridviewComponent extends BaseGrid {
|
|
|
9114
9130
|
const height = this.height;
|
|
9115
9131
|
this.gridview.deserialize(grid, {
|
|
9116
9132
|
fromJSON: (node) => {
|
|
9117
|
-
var _a, _b;
|
|
9118
9133
|
const { data } = node;
|
|
9119
|
-
const view =
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
}
|
|
9124
|
-
: undefined);
|
|
9134
|
+
const view = this.options.createComponent({
|
|
9135
|
+
id: data.id,
|
|
9136
|
+
name: data.component,
|
|
9137
|
+
});
|
|
9125
9138
|
queue.push(() => view.init({
|
|
9126
9139
|
params: data.params,
|
|
9127
9140
|
minimumWidth: data.minimumWidth,
|
|
@@ -9199,7 +9212,7 @@ class GridviewComponent extends BaseGrid {
|
|
|
9199
9212
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9200
9213
|
}
|
|
9201
9214
|
addPanel(options) {
|
|
9202
|
-
var _a, _b, _c, _d
|
|
9215
|
+
var _a, _b, _c, _d;
|
|
9203
9216
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9204
9217
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9205
9218
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9215,14 +9228,12 @@ class GridviewComponent extends BaseGrid {
|
|
|
9215
9228
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9216
9229
|
}
|
|
9217
9230
|
}
|
|
9218
|
-
const view =
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
}
|
|
9223
|
-
: undefined);
|
|
9231
|
+
const view = this.options.createComponent({
|
|
9232
|
+
id: options.id,
|
|
9233
|
+
name: options.component,
|
|
9234
|
+
});
|
|
9224
9235
|
view.init({
|
|
9225
|
-
params: (
|
|
9236
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9226
9237
|
minimumWidth: options.minimumWidth,
|
|
9227
9238
|
maximumWidth: options.maximumWidth,
|
|
9228
9239
|
minimumHeight: options.minimumHeight,
|
|
@@ -9350,12 +9361,6 @@ class SplitviewComponent extends Resizable {
|
|
|
9350
9361
|
this._classNames = new Classnames(this.element);
|
|
9351
9362
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9352
9363
|
this._options = options;
|
|
9353
|
-
if (!options.components) {
|
|
9354
|
-
options.components = {};
|
|
9355
|
-
}
|
|
9356
|
-
if (!options.frameworkComponents) {
|
|
9357
|
-
options.frameworkComponents = {};
|
|
9358
|
-
}
|
|
9359
9364
|
this.splitview = new Splitview(this.element, options);
|
|
9360
9365
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9361
9366
|
}
|
|
@@ -9418,18 +9423,17 @@ class SplitviewComponent extends Resizable {
|
|
|
9418
9423
|
return this.panels.find((view) => view.id === id);
|
|
9419
9424
|
}
|
|
9420
9425
|
addPanel(options) {
|
|
9421
|
-
var _a
|
|
9426
|
+
var _a;
|
|
9422
9427
|
if (this._panels.has(options.id)) {
|
|
9423
9428
|
throw new Error(`panel ${options.id} already exists`);
|
|
9424
9429
|
}
|
|
9425
|
-
const view =
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
: undefined);
|
|
9430
|
+
const view = this.options.createComponent({
|
|
9431
|
+
id: options.id,
|
|
9432
|
+
name: options.component,
|
|
9433
|
+
});
|
|
9430
9434
|
view.orientation = this.splitview.orientation;
|
|
9431
9435
|
view.init({
|
|
9432
|
-
params: (
|
|
9436
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9433
9437
|
minimumSize: options.minimumSize,
|
|
9434
9438
|
maximumSize: options.maximumSize,
|
|
9435
9439
|
snap: options.snap,
|
|
@@ -9491,17 +9495,14 @@ class SplitviewComponent extends Resizable {
|
|
|
9491
9495
|
descriptor: {
|
|
9492
9496
|
size,
|
|
9493
9497
|
views: views.map((view) => {
|
|
9494
|
-
var _a, _b;
|
|
9495
9498
|
const data = view.data;
|
|
9496
9499
|
if (this._panels.has(data.id)) {
|
|
9497
9500
|
throw new Error(`panel ${data.id} already exists`);
|
|
9498
9501
|
}
|
|
9499
|
-
const panel =
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
}
|
|
9504
|
-
: undefined);
|
|
9502
|
+
const panel = this.options.createComponent({
|
|
9503
|
+
id: data.id,
|
|
9504
|
+
name: data.component,
|
|
9505
|
+
});
|
|
9505
9506
|
queue.push(() => {
|
|
9506
9507
|
var _a;
|
|
9507
9508
|
panel.init({
|
|
@@ -9684,16 +9685,12 @@ class PaneviewComponent extends Resizable {
|
|
|
9684
9685
|
this.onDidAddView = this._onDidAddView.event;
|
|
9685
9686
|
this._onDidRemoveView = new Emitter();
|
|
9686
9687
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9687
|
-
this.
|
|
9688
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9689
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9690
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9688
9691
|
this._classNames = new Classnames(this.element);
|
|
9689
9692
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9690
9693
|
this._options = options;
|
|
9691
|
-
if (!options.components) {
|
|
9692
|
-
options.components = {};
|
|
9693
|
-
}
|
|
9694
|
-
if (!options.frameworkComponents) {
|
|
9695
|
-
options.frameworkComponents = {};
|
|
9696
|
-
}
|
|
9697
9694
|
this.paneview = new Paneview(this.element, {
|
|
9698
9695
|
// only allow paneview in the vertical orientation for now
|
|
9699
9696
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9718,22 +9715,19 @@ class PaneviewComponent extends Resizable {
|
|
|
9718
9715
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9719
9716
|
}
|
|
9720
9717
|
addPanel(options) {
|
|
9721
|
-
var _a
|
|
9722
|
-
const body =
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
: undefined);
|
|
9718
|
+
var _a;
|
|
9719
|
+
const body = this.options.createComponent({
|
|
9720
|
+
id: options.id,
|
|
9721
|
+
name: options.component,
|
|
9722
|
+
});
|
|
9727
9723
|
let header;
|
|
9728
|
-
if (options.headerComponent) {
|
|
9729
|
-
header =
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
}
|
|
9734
|
-
: undefined);
|
|
9724
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9725
|
+
header = this.options.createHeaderComponent({
|
|
9726
|
+
id: options.id,
|
|
9727
|
+
name: options.headerComponent,
|
|
9728
|
+
});
|
|
9735
9729
|
}
|
|
9736
|
-
|
|
9730
|
+
if (!header) {
|
|
9737
9731
|
header = new DefaultHeader();
|
|
9738
9732
|
}
|
|
9739
9733
|
const view = new PaneFramework({
|
|
@@ -9751,7 +9745,7 @@ class PaneviewComponent extends Resizable {
|
|
|
9751
9745
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9752
9746
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9753
9747
|
view.init({
|
|
9754
|
-
params: (
|
|
9748
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9755
9749
|
minimumBodySize: options.minimumBodySize,
|
|
9756
9750
|
maximumBodySize: options.maximumBodySize,
|
|
9757
9751
|
isExpanded: options.isExpanded,
|
|
@@ -9816,24 +9810,20 @@ class PaneviewComponent extends Resizable {
|
|
|
9816
9810
|
descriptor: {
|
|
9817
9811
|
size,
|
|
9818
9812
|
views: views.map((view) => {
|
|
9819
|
-
var _a, _b, _c, _d;
|
|
9820
9813
|
const data = view.data;
|
|
9821
|
-
const body =
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
}
|
|
9826
|
-
: undefined);
|
|
9814
|
+
const body = this.options.createComponent({
|
|
9815
|
+
id: data.id,
|
|
9816
|
+
name: data.component,
|
|
9817
|
+
});
|
|
9827
9818
|
let header;
|
|
9828
|
-
if (data.headerComponent
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
: undefined);
|
|
9819
|
+
if (data.headerComponent &&
|
|
9820
|
+
this.options.createHeaderComponent) {
|
|
9821
|
+
header = this.options.createHeaderComponent({
|
|
9822
|
+
id: data.id,
|
|
9823
|
+
name: data.headerComponent,
|
|
9824
|
+
});
|
|
9835
9825
|
}
|
|
9836
|
-
|
|
9826
|
+
if (!header) {
|
|
9837
9827
|
header = new DefaultHeader();
|
|
9838
9828
|
}
|
|
9839
9829
|
const panel = new PaneFramework({
|
|
@@ -9881,9 +9871,11 @@ class PaneviewComponent extends Resizable {
|
|
|
9881
9871
|
this.paneview.dispose();
|
|
9882
9872
|
}
|
|
9883
9873
|
doAddPanel(panel) {
|
|
9884
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9874
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9885
9875
|
this._onDidDrop.fire(event);
|
|
9886
|
-
})
|
|
9876
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9877
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9878
|
+
}));
|
|
9887
9879
|
this._viewDisposables.set(panel.id, disposable);
|
|
9888
9880
|
}
|
|
9889
9881
|
doRemovePanel(panel) {
|
|
@@ -10166,7 +10158,7 @@ class ReactPanelContentPart {
|
|
|
10166
10158
|
this._onDidBlur = new Emitter();
|
|
10167
10159
|
this.onDidBlur = this._onDidBlur.event;
|
|
10168
10160
|
this._element = document.createElement('div');
|
|
10169
|
-
this._element.className = '
|
|
10161
|
+
this._element.className = 'dv-react-part';
|
|
10170
10162
|
this._element.style.height = '100%';
|
|
10171
10163
|
this._element.style.width = '100%';
|
|
10172
10164
|
}
|
|
@@ -10204,7 +10196,7 @@ class ReactPanelHeaderPart {
|
|
|
10204
10196
|
this.component = component;
|
|
10205
10197
|
this.reactPortalStore = reactPortalStore;
|
|
10206
10198
|
this._element = document.createElement('div');
|
|
10207
|
-
this._element.className = '
|
|
10199
|
+
this._element.className = 'dv-react-part';
|
|
10208
10200
|
this._element.style.height = '100%';
|
|
10209
10201
|
this._element.style.width = '100%';
|
|
10210
10202
|
}
|
|
@@ -10240,7 +10232,7 @@ class ReactWatermarkPart {
|
|
|
10240
10232
|
this.component = component;
|
|
10241
10233
|
this.reactPortalStore = reactPortalStore;
|
|
10242
10234
|
this._element = document.createElement('div');
|
|
10243
|
-
this._element.className = '
|
|
10235
|
+
this._element.className = 'dv-react-part';
|
|
10244
10236
|
this._element.style.height = '100%';
|
|
10245
10237
|
this._element.style.width = '100%';
|
|
10246
10238
|
}
|
|
@@ -10282,7 +10274,7 @@ class ReactHeaderActionsRendererPart {
|
|
|
10282
10274
|
this._group = _group;
|
|
10283
10275
|
this.mutableDisposable = new MutableDisposable();
|
|
10284
10276
|
this._element = document.createElement('div');
|
|
10285
|
-
this._element.className = '
|
|
10277
|
+
this._element.className = 'dv-react-part';
|
|
10286
10278
|
this._element.style.height = '100%';
|
|
10287
10279
|
this._element.style.width = '100%';
|
|
10288
10280
|
}
|
|
@@ -10341,8 +10333,8 @@ function createGroupControlElement(component, store) {
|
|
|
10341
10333
|
: undefined;
|
|
10342
10334
|
}
|
|
10343
10335
|
const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
|
|
10344
|
-
function extractCoreOptions(props) {
|
|
10345
|
-
const coreOptions =
|
|
10336
|
+
function extractCoreOptions$3(props) {
|
|
10337
|
+
const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
|
|
10346
10338
|
if (key in props) {
|
|
10347
10339
|
obj[key] = props[key];
|
|
10348
10340
|
}
|
|
@@ -10358,7 +10350,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
10358
10350
|
const prevProps = React.useRef({});
|
|
10359
10351
|
React.useEffect(() => {
|
|
10360
10352
|
const changes = {};
|
|
10361
|
-
|
|
10353
|
+
PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
|
|
10362
10354
|
const key = propKey;
|
|
10363
10355
|
const propValue = props[key];
|
|
10364
10356
|
if (key in props && propValue !== prevProps.current[key]) {
|
|
@@ -10369,7 +10361,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
10369
10361
|
dockviewRef.current.updateOptions(changes);
|
|
10370
10362
|
}
|
|
10371
10363
|
prevProps.current = props;
|
|
10372
|
-
},
|
|
10364
|
+
}, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
|
|
10373
10365
|
React.useEffect(() => {
|
|
10374
10366
|
var _a;
|
|
10375
10367
|
if (!domRef.current) {
|
|
@@ -10405,7 +10397,7 @@ const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
10405
10397
|
? DEFAULT_REACT_TAB
|
|
10406
10398
|
: undefined,
|
|
10407
10399
|
};
|
|
10408
|
-
const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
10400
|
+
const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
|
|
10409
10401
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10410
10402
|
api.layout(clientWidth, clientHeight);
|
|
10411
10403
|
if (props.onReady) {
|
|
@@ -10616,31 +10608,47 @@ class ReactPanelView extends SplitviewPanel {
|
|
|
10616
10608
|
}
|
|
10617
10609
|
}
|
|
10618
10610
|
|
|
10611
|
+
function extractCoreOptions$2(props) {
|
|
10612
|
+
const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
|
|
10613
|
+
if (key in props) {
|
|
10614
|
+
obj[key] = props[key];
|
|
10615
|
+
}
|
|
10616
|
+
return obj;
|
|
10617
|
+
}, {});
|
|
10618
|
+
return coreOptions;
|
|
10619
|
+
}
|
|
10619
10620
|
const SplitviewReact = React.forwardRef((props, ref) => {
|
|
10620
10621
|
const domRef = React.useRef(null);
|
|
10621
10622
|
const splitviewRef = React.useRef();
|
|
10622
10623
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10623
10624
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10625
|
+
const prevProps = React.useRef({});
|
|
10624
10626
|
React.useEffect(() => {
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
return new ReactPanelView(id, componentId, component, {
|
|
10633
|
-
addPortal,
|
|
10634
|
-
});
|
|
10635
|
-
},
|
|
10636
|
-
},
|
|
10637
|
-
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
10638
|
-
? props.proportionalLayout
|
|
10639
|
-
: true,
|
|
10640
|
-
styles: props.hideBorders
|
|
10641
|
-
? { separatorBorder: 'transparent' }
|
|
10642
|
-
: undefined,
|
|
10627
|
+
const changes = {};
|
|
10628
|
+
PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
|
|
10629
|
+
const key = propKey;
|
|
10630
|
+
const propValue = props[key];
|
|
10631
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10632
|
+
changes[key] = propValue;
|
|
10633
|
+
}
|
|
10643
10634
|
});
|
|
10635
|
+
if (splitviewRef.current) {
|
|
10636
|
+
splitviewRef.current.updateOptions(changes);
|
|
10637
|
+
}
|
|
10638
|
+
prevProps.current = props;
|
|
10639
|
+
}, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
|
|
10640
|
+
React.useEffect(() => {
|
|
10641
|
+
if (!domRef.current) {
|
|
10642
|
+
return () => {
|
|
10643
|
+
// noop
|
|
10644
|
+
};
|
|
10645
|
+
}
|
|
10646
|
+
const frameworkOptions = {
|
|
10647
|
+
createComponent: (options) => {
|
|
10648
|
+
return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10649
|
+
},
|
|
10650
|
+
};
|
|
10651
|
+
const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
|
|
10644
10652
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10645
10653
|
api.layout(clientWidth, clientHeight);
|
|
10646
10654
|
if (props.onReady) {
|
|
@@ -10656,7 +10664,9 @@ const SplitviewReact = React.forwardRef((props, ref) => {
|
|
|
10656
10664
|
return;
|
|
10657
10665
|
}
|
|
10658
10666
|
splitviewRef.current.updateOptions({
|
|
10659
|
-
|
|
10667
|
+
createComponent: (options) => {
|
|
10668
|
+
return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10669
|
+
},
|
|
10660
10670
|
});
|
|
10661
10671
|
}, [props.components]);
|
|
10662
10672
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
@@ -10681,36 +10691,47 @@ class ReactGridPanelView extends GridviewPanel {
|
|
|
10681
10691
|
}
|
|
10682
10692
|
}
|
|
10683
10693
|
|
|
10694
|
+
function extractCoreOptions$1(props) {
|
|
10695
|
+
const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
|
|
10696
|
+
if (key in props) {
|
|
10697
|
+
obj[key] = props[key];
|
|
10698
|
+
}
|
|
10699
|
+
return obj;
|
|
10700
|
+
}, {});
|
|
10701
|
+
return coreOptions;
|
|
10702
|
+
}
|
|
10684
10703
|
const GridviewReact = React.forwardRef((props, ref) => {
|
|
10685
10704
|
const domRef = React.useRef(null);
|
|
10686
10705
|
const gridviewRef = React.useRef();
|
|
10687
10706
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10688
10707
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10708
|
+
const prevProps = React.useRef({});
|
|
10709
|
+
React.useEffect(() => {
|
|
10710
|
+
const changes = {};
|
|
10711
|
+
PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
|
|
10712
|
+
const key = propKey;
|
|
10713
|
+
const propValue = props[key];
|
|
10714
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10715
|
+
changes[key] = propValue;
|
|
10716
|
+
}
|
|
10717
|
+
});
|
|
10718
|
+
if (gridviewRef.current) {
|
|
10719
|
+
gridviewRef.current.updateOptions(changes);
|
|
10720
|
+
}
|
|
10721
|
+
prevProps.current = props;
|
|
10722
|
+
}, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
|
|
10689
10723
|
React.useEffect(() => {
|
|
10690
|
-
var _a;
|
|
10691
10724
|
if (!domRef.current) {
|
|
10692
10725
|
return () => {
|
|
10693
10726
|
// noop
|
|
10694
10727
|
};
|
|
10695
10728
|
}
|
|
10696
|
-
const
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
? props.proportionalLayout
|
|
10700
|
-
: true,
|
|
10701
|
-
orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
|
|
10702
|
-
frameworkComponents: props.components,
|
|
10703
|
-
frameworkComponentFactory: {
|
|
10704
|
-
createComponent: (id, componentId, component) => {
|
|
10705
|
-
return new ReactGridPanelView(id, componentId, component, {
|
|
10706
|
-
addPortal,
|
|
10707
|
-
});
|
|
10708
|
-
},
|
|
10729
|
+
const frameworkOptions = {
|
|
10730
|
+
createComponent: (options) => {
|
|
10731
|
+
return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10709
10732
|
},
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
: undefined,
|
|
10713
|
-
});
|
|
10733
|
+
};
|
|
10734
|
+
const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
|
|
10714
10735
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10715
10736
|
api.layout(clientWidth, clientHeight);
|
|
10716
10737
|
if (props.onReady) {
|
|
@@ -10726,7 +10747,9 @@ const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
10726
10747
|
return;
|
|
10727
10748
|
}
|
|
10728
10749
|
gridviewRef.current.updateOptions({
|
|
10729
|
-
|
|
10750
|
+
createComponent: (options) => {
|
|
10751
|
+
return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10752
|
+
},
|
|
10730
10753
|
});
|
|
10731
10754
|
}, [props.components]);
|
|
10732
10755
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
@@ -10768,32 +10791,52 @@ class PanePanelSection {
|
|
|
10768
10791
|
}
|
|
10769
10792
|
}
|
|
10770
10793
|
|
|
10794
|
+
function extractCoreOptions(props) {
|
|
10795
|
+
const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
|
|
10796
|
+
if (key in props) {
|
|
10797
|
+
obj[key] = props[key];
|
|
10798
|
+
}
|
|
10799
|
+
return obj;
|
|
10800
|
+
}, {});
|
|
10801
|
+
return coreOptions;
|
|
10802
|
+
}
|
|
10771
10803
|
const PaneviewReact = React.forwardRef((props, ref) => {
|
|
10772
10804
|
const domRef = React.useRef(null);
|
|
10773
10805
|
const paneviewRef = React.useRef();
|
|
10774
10806
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10775
10807
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10808
|
+
const prevProps = React.useRef({});
|
|
10776
10809
|
React.useEffect(() => {
|
|
10777
|
-
const
|
|
10778
|
-
|
|
10810
|
+
const changes = {};
|
|
10811
|
+
PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
|
|
10812
|
+
const key = propKey;
|
|
10813
|
+
const propValue = props[key];
|
|
10814
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10815
|
+
changes[key] = propValue;
|
|
10816
|
+
}
|
|
10779
10817
|
});
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10818
|
+
if (paneviewRef.current) {
|
|
10819
|
+
paneviewRef.current.updateOptions(changes);
|
|
10820
|
+
}
|
|
10821
|
+
prevProps.current = props;
|
|
10822
|
+
}, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
|
|
10823
|
+
React.useEffect(() => {
|
|
10824
|
+
var _a;
|
|
10825
|
+
if (!domRef.current) {
|
|
10826
|
+
return () => {
|
|
10827
|
+
// noop
|
|
10828
|
+
};
|
|
10829
|
+
}
|
|
10830
|
+
const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
10831
|
+
const frameworkOptions = {
|
|
10832
|
+
createComponent: (options) => {
|
|
10833
|
+
return new PanePanelSection(options.id, props.components[options.name], { addPortal });
|
|
10794
10834
|
},
|
|
10795
|
-
|
|
10796
|
-
|
|
10835
|
+
createHeaderComponent: (options) => {
|
|
10836
|
+
return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
|
|
10837
|
+
},
|
|
10838
|
+
};
|
|
10839
|
+
const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
10797
10840
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10798
10841
|
api.layout(clientWidth, clientHeight);
|
|
10799
10842
|
if (props.onReady) {
|
|
@@ -10809,41 +10852,38 @@ const PaneviewReact = React.forwardRef((props, ref) => {
|
|
|
10809
10852
|
return;
|
|
10810
10853
|
}
|
|
10811
10854
|
paneviewRef.current.updateOptions({
|
|
10812
|
-
|
|
10855
|
+
createComponent: (options) => {
|
|
10856
|
+
return new PanePanelSection(options.id, props.components[options.name], { addPortal });
|
|
10857
|
+
},
|
|
10813
10858
|
});
|
|
10814
10859
|
}, [props.components]);
|
|
10815
10860
|
React.useEffect(() => {
|
|
10861
|
+
var _a;
|
|
10816
10862
|
if (!paneviewRef.current) {
|
|
10817
10863
|
return;
|
|
10818
10864
|
}
|
|
10865
|
+
const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
10819
10866
|
paneviewRef.current.updateOptions({
|
|
10820
|
-
|
|
10867
|
+
createHeaderComponent: (options) => {
|
|
10868
|
+
return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
|
|
10869
|
+
},
|
|
10821
10870
|
});
|
|
10822
10871
|
}, [props.headerComponents]);
|
|
10823
10872
|
React.useEffect(() => {
|
|
10824
10873
|
if (!paneviewRef.current) {
|
|
10825
10874
|
return () => {
|
|
10826
|
-
//
|
|
10875
|
+
// noop
|
|
10827
10876
|
};
|
|
10828
10877
|
}
|
|
10829
|
-
const
|
|
10830
|
-
const disposable = api.onDidDrop((event) => {
|
|
10878
|
+
const disposable = paneviewRef.current.onDidDrop((event) => {
|
|
10831
10879
|
if (props.onDidDrop) {
|
|
10832
|
-
props.onDidDrop(
|
|
10880
|
+
props.onDidDrop(event);
|
|
10833
10881
|
}
|
|
10834
10882
|
});
|
|
10835
10883
|
return () => {
|
|
10836
10884
|
disposable.dispose();
|
|
10837
10885
|
};
|
|
10838
10886
|
}, [props.onDidDrop]);
|
|
10839
|
-
React.useEffect(() => {
|
|
10840
|
-
if (!paneviewRef.current) {
|
|
10841
|
-
return;
|
|
10842
|
-
}
|
|
10843
|
-
paneviewRef.current.updateOptions({
|
|
10844
|
-
showDndOverlay: props.showDndOverlay,
|
|
10845
|
-
});
|
|
10846
|
-
}, [props.showDndOverlay]);
|
|
10847
10887
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
10848
10888
|
});
|
|
10849
10889
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
@@ -10871,7 +10911,10 @@ exports.GridviewApi = GridviewApi;
|
|
|
10871
10911
|
exports.GridviewComponent = GridviewComponent;
|
|
10872
10912
|
exports.GridviewPanel = GridviewPanel;
|
|
10873
10913
|
exports.GridviewReact = GridviewReact;
|
|
10874
|
-
exports.
|
|
10914
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10915
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10916
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10917
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10875
10918
|
exports.PaneFramework = PaneFramework;
|
|
10876
10919
|
exports.PaneTransfer = PaneTransfer;
|
|
10877
10920
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10880,6 +10923,7 @@ exports.PaneviewApi = PaneviewApi;
|
|
|
10880
10923
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10881
10924
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10882
10925
|
exports.PaneviewReact = PaneviewReact;
|
|
10926
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10883
10927
|
exports.ReactPart = ReactPart;
|
|
10884
10928
|
exports.ReactPartContext = ReactPartContext;
|
|
10885
10929
|
exports.Splitview = Splitview;
|