dockview 2.1.4 → 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 +287 -238
- 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 +287 -238
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +287 -238
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +283 -238
- 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 +287 -238
- 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 +287 -238
- 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.amd.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
|
*/
|
|
@@ -129,6 +129,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
129
129
|
this._defaultPrevented = true;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
class AcceptableEvent {
|
|
133
|
+
constructor() {
|
|
134
|
+
this._isAccepted = false;
|
|
135
|
+
}
|
|
136
|
+
get isAccepted() {
|
|
137
|
+
return this._isAccepted;
|
|
138
|
+
}
|
|
139
|
+
accept() {
|
|
140
|
+
this._isAccepted = true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
132
143
|
class LeakageMonitor {
|
|
133
144
|
constructor() {
|
|
134
145
|
this.events = new Map();
|
|
@@ -1520,6 +1531,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1520
1531
|
}
|
|
1521
1532
|
}
|
|
1522
1533
|
|
|
1534
|
+
const PROPERTY_KEYS_SPLITVIEW = (() => {
|
|
1535
|
+
/**
|
|
1536
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
1537
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
1538
|
+
*/
|
|
1539
|
+
const properties = {
|
|
1540
|
+
orientation: undefined,
|
|
1541
|
+
descriptor: undefined,
|
|
1542
|
+
proportionalLayout: undefined,
|
|
1543
|
+
styles: undefined,
|
|
1544
|
+
margin: undefined,
|
|
1545
|
+
disableAutoResizing: undefined,
|
|
1546
|
+
className: undefined,
|
|
1547
|
+
};
|
|
1548
|
+
return Object.keys(properties);
|
|
1549
|
+
})();
|
|
1550
|
+
|
|
1523
1551
|
class Paneview extends CompositeDisposable {
|
|
1524
1552
|
get onDidAddView() {
|
|
1525
1553
|
return this.splitview.onDidAddView;
|
|
@@ -2649,6 +2677,21 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2649
2677
|
}
|
|
2650
2678
|
}
|
|
2651
2679
|
|
|
2680
|
+
const PROPERTY_KEYS_GRIDVIEW = (() => {
|
|
2681
|
+
/**
|
|
2682
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
2683
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
2684
|
+
*/
|
|
2685
|
+
const properties = {
|
|
2686
|
+
disableAutoResizing: undefined,
|
|
2687
|
+
proportionalLayout: undefined,
|
|
2688
|
+
orientation: undefined,
|
|
2689
|
+
hideBorders: undefined,
|
|
2690
|
+
className: undefined,
|
|
2691
|
+
};
|
|
2692
|
+
return Object.keys(properties);
|
|
2693
|
+
})();
|
|
2694
|
+
|
|
2652
2695
|
class Resizable extends CompositeDisposable {
|
|
2653
2696
|
get element() {
|
|
2654
2697
|
return this._element;
|
|
@@ -3126,15 +3169,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3126
3169
|
* Invoked when a Drag'n'Drop event occurs that the component was unable to handle. Exposed for custom Drag'n'Drop functionality.
|
|
3127
3170
|
*/
|
|
3128
3171
|
get onDidDrop() {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
emitter.dispose = () => {
|
|
3134
|
-
disposable.dispose();
|
|
3135
|
-
emitter.dispose();
|
|
3136
|
-
};
|
|
3137
|
-
return emitter.event;
|
|
3172
|
+
return this.component.onDidDrop;
|
|
3173
|
+
}
|
|
3174
|
+
get onUnhandledDragOverEvent() {
|
|
3175
|
+
return this.component.onUnhandledDragOverEvent;
|
|
3138
3176
|
}
|
|
3139
3177
|
constructor(component) {
|
|
3140
3178
|
this.component = component;
|
|
@@ -4061,6 +4099,28 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4061
4099
|
return 'center';
|
|
4062
4100
|
}
|
|
4063
4101
|
|
|
4102
|
+
const PROPERTY_KEYS_PANEVIEW = (() => {
|
|
4103
|
+
/**
|
|
4104
|
+
* by readong the keys from an empty value object TypeScript will error
|
|
4105
|
+
* when we add or remove new properties to `DockviewOptions`
|
|
4106
|
+
*/
|
|
4107
|
+
const properties = {
|
|
4108
|
+
disableAutoResizing: undefined,
|
|
4109
|
+
disableDnd: undefined,
|
|
4110
|
+
className: undefined,
|
|
4111
|
+
};
|
|
4112
|
+
return Object.keys(properties);
|
|
4113
|
+
})();
|
|
4114
|
+
class PaneviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
4115
|
+
constructor(nativeEvent, position, getData, panel) {
|
|
4116
|
+
super();
|
|
4117
|
+
this.nativeEvent = nativeEvent;
|
|
4118
|
+
this.position = position;
|
|
4119
|
+
this.getData = getData;
|
|
4120
|
+
this.panel = panel;
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4064
4124
|
class WillFocusEvent extends DockviewEvent {
|
|
4065
4125
|
constructor() {
|
|
4066
4126
|
super();
|
|
@@ -4484,6 +4544,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4484
4544
|
this.accessor = accessor;
|
|
4485
4545
|
this._onDidDrop = new Emitter();
|
|
4486
4546
|
this.onDidDrop = this._onDidDrop.event;
|
|
4547
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
4548
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4549
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4487
4550
|
if (!disableDnd) {
|
|
4488
4551
|
this.initDragFeatures();
|
|
4489
4552
|
}
|
|
@@ -4510,7 +4573,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4510
4573
|
overlayModel: {
|
|
4511
4574
|
activationSize: { type: 'percentage', value: 50 },
|
|
4512
4575
|
},
|
|
4513
|
-
canDisplayOverlay: (event) => {
|
|
4576
|
+
canDisplayOverlay: (event, position) => {
|
|
4514
4577
|
const data = getPaneData();
|
|
4515
4578
|
if (data) {
|
|
4516
4579
|
if (data.paneId !== this.id &&
|
|
@@ -4518,14 +4581,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4518
4581
|
return true;
|
|
4519
4582
|
}
|
|
4520
4583
|
}
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
getData: getPaneData,
|
|
4525
|
-
panel: this,
|
|
4526
|
-
});
|
|
4527
|
-
}
|
|
4528
|
-
return false;
|
|
4584
|
+
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
4585
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
4586
|
+
return firedEvent.isAccepted;
|
|
4529
4587
|
},
|
|
4530
4588
|
});
|
|
4531
4589
|
this.addDisposables(this._onDidDrop, this.handler, this.target, this.target.onDrop((event) => {
|
|
@@ -4980,15 +5038,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4980
5038
|
this._element.appendChild(this.leftActionsContainer);
|
|
4981
5039
|
this._element.appendChild(this.voidContainer.element);
|
|
4982
5040
|
this._element.appendChild(this.rightActionsContainer);
|
|
4983
|
-
this.addDisposables(this.
|
|
4984
|
-
if (e.api.group === this.group) {
|
|
4985
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4986
|
-
}
|
|
4987
|
-
}), this.accessor.onDidRemovePanel((e) => {
|
|
4988
|
-
if (e.api.group === this.group) {
|
|
4989
|
-
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
4990
|
-
}
|
|
4991
|
-
}), this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
5041
|
+
this.addDisposables(this._onWillShowOverlay, this._onDrop, this._onTabDragStart, this._onGroupDragStart, this.voidContainer, this.voidContainer.onDragStart((event) => {
|
|
4992
5042
|
this._onGroupDragStart.fire({
|
|
4993
5043
|
nativeEvent: event,
|
|
4994
5044
|
group: this.group,
|
|
@@ -5033,20 +5083,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5033
5083
|
setActive(_isGroupActive) {
|
|
5034
5084
|
// noop
|
|
5035
5085
|
}
|
|
5036
|
-
addTab(tab, index = this.tabs.length) {
|
|
5037
|
-
if (index < 0 || index > this.tabs.length) {
|
|
5038
|
-
throw new Error('invalid location');
|
|
5039
|
-
}
|
|
5040
|
-
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5041
|
-
this.tabs = [
|
|
5042
|
-
...this.tabs.slice(0, index),
|
|
5043
|
-
tab,
|
|
5044
|
-
...this.tabs.slice(index),
|
|
5045
|
-
];
|
|
5046
|
-
if (this.selectedIndex < 0) {
|
|
5047
|
-
this.selectedIndex = index;
|
|
5048
|
-
}
|
|
5049
|
-
}
|
|
5050
5086
|
delete(id) {
|
|
5051
5087
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5052
5088
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
@@ -5054,6 +5090,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5054
5090
|
disposable.dispose();
|
|
5055
5091
|
value.dispose();
|
|
5056
5092
|
value.element.remove();
|
|
5093
|
+
this.updateClassnames();
|
|
5057
5094
|
}
|
|
5058
5095
|
setActivePanel(panel) {
|
|
5059
5096
|
this.tabs.forEach((tab) => {
|
|
@@ -5122,25 +5159,37 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5122
5159
|
}
|
|
5123
5160
|
this.tabs = [];
|
|
5124
5161
|
}
|
|
5162
|
+
addTab(tab, index = this.tabs.length) {
|
|
5163
|
+
if (index < 0 || index > this.tabs.length) {
|
|
5164
|
+
throw new Error('invalid location');
|
|
5165
|
+
}
|
|
5166
|
+
this.tabContainer.insertBefore(tab.value.element, this.tabContainer.children[index]);
|
|
5167
|
+
this.tabs = [
|
|
5168
|
+
...this.tabs.slice(0, index),
|
|
5169
|
+
tab,
|
|
5170
|
+
...this.tabs.slice(index),
|
|
5171
|
+
];
|
|
5172
|
+
if (this.selectedIndex < 0) {
|
|
5173
|
+
this.selectedIndex = index;
|
|
5174
|
+
}
|
|
5175
|
+
this.updateClassnames();
|
|
5176
|
+
}
|
|
5177
|
+
updateClassnames() {
|
|
5178
|
+
toggleClass(this._element, 'dv-single-tab', this.size === 1);
|
|
5179
|
+
}
|
|
5125
5180
|
}
|
|
5126
5181
|
|
|
5127
|
-
class DockviewUnhandledDragOverEvent {
|
|
5128
|
-
get isAccepted() {
|
|
5129
|
-
return this._isAccepted;
|
|
5130
|
-
}
|
|
5182
|
+
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
5131
5183
|
constructor(nativeEvent, target, position, getData, group) {
|
|
5184
|
+
super();
|
|
5132
5185
|
this.nativeEvent = nativeEvent;
|
|
5133
5186
|
this.target = target;
|
|
5134
5187
|
this.position = position;
|
|
5135
5188
|
this.getData = getData;
|
|
5136
5189
|
this.group = group;
|
|
5137
|
-
this._isAccepted = false;
|
|
5138
|
-
}
|
|
5139
|
-
accept() {
|
|
5140
|
-
this._isAccepted = true;
|
|
5141
5190
|
}
|
|
5142
5191
|
}
|
|
5143
|
-
const
|
|
5192
|
+
const PROPERTY_KEYS_DOCKVIEW = (() => {
|
|
5144
5193
|
/**
|
|
5145
5194
|
* by readong the keys from an empty value object TypeScript will error
|
|
5146
5195
|
* when we add or remove new properties to `DockviewOptions`
|
|
@@ -8986,31 +9035,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8986
9035
|
}
|
|
8987
9036
|
}
|
|
8988
9037
|
|
|
8989
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8990
|
-
const Component = typeof componentName === 'string'
|
|
8991
|
-
? components[componentName]
|
|
8992
|
-
: undefined;
|
|
8993
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
8994
|
-
? frameworkComponents[componentName]
|
|
8995
|
-
: undefined;
|
|
8996
|
-
if (Component && FrameworkComponent) {
|
|
8997
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
8998
|
-
}
|
|
8999
|
-
if (FrameworkComponent) {
|
|
9000
|
-
if (!createFrameworkComponent) {
|
|
9001
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
9002
|
-
}
|
|
9003
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
9004
|
-
}
|
|
9005
|
-
if (!Component) {
|
|
9006
|
-
if (fallback) {
|
|
9007
|
-
return fallback();
|
|
9008
|
-
}
|
|
9009
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
9010
|
-
}
|
|
9011
|
-
return new Component(id, componentName);
|
|
9012
|
-
}
|
|
9013
|
-
|
|
9014
9038
|
class GridviewComponent extends BaseGrid {
|
|
9015
9039
|
get orientation() {
|
|
9016
9040
|
return this.gridview.orientation;
|
|
@@ -9028,10 +9052,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9028
9052
|
this._deserializer = value;
|
|
9029
9053
|
}
|
|
9030
9054
|
constructor(parentElement, options) {
|
|
9055
|
+
var _a;
|
|
9031
9056
|
super(parentElement, {
|
|
9032
|
-
proportionalLayout: options.proportionalLayout,
|
|
9057
|
+
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9033
9058
|
orientation: options.orientation,
|
|
9034
|
-
styles: options.
|
|
9059
|
+
styles: options.hideBorders
|
|
9060
|
+
? { separatorBorder: 'transparent' }
|
|
9061
|
+
: undefined,
|
|
9035
9062
|
disableAutoResizing: options.disableAutoResizing,
|
|
9036
9063
|
className: options.className,
|
|
9037
9064
|
});
|
|
@@ -9051,12 +9078,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9051
9078
|
}), this.onDidActiveChange((event) => {
|
|
9052
9079
|
this._onDidActiveGroupChange.fire(event);
|
|
9053
9080
|
}));
|
|
9054
|
-
if (!this.options.components) {
|
|
9055
|
-
this.options.components = {};
|
|
9056
|
-
}
|
|
9057
|
-
if (!this.options.frameworkComponents) {
|
|
9058
|
-
this.options.frameworkComponents = {};
|
|
9059
|
-
}
|
|
9060
9081
|
}
|
|
9061
9082
|
updateOptions(options) {
|
|
9062
9083
|
super.updateOptions(options);
|
|
@@ -9106,14 +9127,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9106
9127
|
const height = this.height;
|
|
9107
9128
|
this.gridview.deserialize(grid, {
|
|
9108
9129
|
fromJSON: (node) => {
|
|
9109
|
-
var _a, _b;
|
|
9110
9130
|
const { data } = node;
|
|
9111
|
-
const view =
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
}
|
|
9116
|
-
: undefined);
|
|
9131
|
+
const view = this.options.createComponent({
|
|
9132
|
+
id: data.id,
|
|
9133
|
+
name: data.component,
|
|
9134
|
+
});
|
|
9117
9135
|
queue.push(() => view.init({
|
|
9118
9136
|
params: data.params,
|
|
9119
9137
|
minimumWidth: data.minimumWidth,
|
|
@@ -9191,7 +9209,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9191
9209
|
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
9192
9210
|
}
|
|
9193
9211
|
addPanel(options) {
|
|
9194
|
-
var _a, _b, _c, _d
|
|
9212
|
+
var _a, _b, _c, _d;
|
|
9195
9213
|
let relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
|
|
9196
9214
|
if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
|
|
9197
9215
|
const referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
|
|
@@ -9207,14 +9225,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9207
9225
|
relativeLocation = getRelativeLocation(this.gridview.orientation, location, target);
|
|
9208
9226
|
}
|
|
9209
9227
|
}
|
|
9210
|
-
const view =
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
}
|
|
9215
|
-
: undefined);
|
|
9228
|
+
const view = this.options.createComponent({
|
|
9229
|
+
id: options.id,
|
|
9230
|
+
name: options.component,
|
|
9231
|
+
});
|
|
9216
9232
|
view.init({
|
|
9217
|
-
params: (
|
|
9233
|
+
params: (_d = options.params) !== null && _d !== void 0 ? _d : {},
|
|
9218
9234
|
minimumWidth: options.minimumWidth,
|
|
9219
9235
|
maximumWidth: options.maximumWidth,
|
|
9220
9236
|
minimumHeight: options.minimumHeight,
|
|
@@ -9342,12 +9358,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9342
9358
|
this._classNames = new Classnames(this.element);
|
|
9343
9359
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9344
9360
|
this._options = options;
|
|
9345
|
-
if (!options.components) {
|
|
9346
|
-
options.components = {};
|
|
9347
|
-
}
|
|
9348
|
-
if (!options.frameworkComponents) {
|
|
9349
|
-
options.frameworkComponents = {};
|
|
9350
|
-
}
|
|
9351
9361
|
this.splitview = new Splitview(this.element, options);
|
|
9352
9362
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
9353
9363
|
}
|
|
@@ -9410,18 +9420,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9410
9420
|
return this.panels.find((view) => view.id === id);
|
|
9411
9421
|
}
|
|
9412
9422
|
addPanel(options) {
|
|
9413
|
-
var _a
|
|
9423
|
+
var _a;
|
|
9414
9424
|
if (this._panels.has(options.id)) {
|
|
9415
9425
|
throw new Error(`panel ${options.id} already exists`);
|
|
9416
9426
|
}
|
|
9417
|
-
const view =
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
: undefined);
|
|
9427
|
+
const view = this.options.createComponent({
|
|
9428
|
+
id: options.id,
|
|
9429
|
+
name: options.component,
|
|
9430
|
+
});
|
|
9422
9431
|
view.orientation = this.splitview.orientation;
|
|
9423
9432
|
view.init({
|
|
9424
|
-
params: (
|
|
9433
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9425
9434
|
minimumSize: options.minimumSize,
|
|
9426
9435
|
maximumSize: options.maximumSize,
|
|
9427
9436
|
snap: options.snap,
|
|
@@ -9483,17 +9492,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9483
9492
|
descriptor: {
|
|
9484
9493
|
size,
|
|
9485
9494
|
views: views.map((view) => {
|
|
9486
|
-
var _a, _b;
|
|
9487
9495
|
const data = view.data;
|
|
9488
9496
|
if (this._panels.has(data.id)) {
|
|
9489
9497
|
throw new Error(`panel ${data.id} already exists`);
|
|
9490
9498
|
}
|
|
9491
|
-
const panel =
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
}
|
|
9496
|
-
: undefined);
|
|
9499
|
+
const panel = this.options.createComponent({
|
|
9500
|
+
id: data.id,
|
|
9501
|
+
name: data.component,
|
|
9502
|
+
});
|
|
9497
9503
|
queue.push(() => {
|
|
9498
9504
|
var _a;
|
|
9499
9505
|
panel.init({
|
|
@@ -9676,16 +9682,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9676
9682
|
this.onDidAddView = this._onDidAddView.event;
|
|
9677
9683
|
this._onDidRemoveView = new Emitter();
|
|
9678
9684
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9679
|
-
this.
|
|
9685
|
+
this._onUnhandledDragOverEvent = new Emitter();
|
|
9686
|
+
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9687
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9680
9688
|
this._classNames = new Classnames(this.element);
|
|
9681
9689
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9682
9690
|
this._options = options;
|
|
9683
|
-
if (!options.components) {
|
|
9684
|
-
options.components = {};
|
|
9685
|
-
}
|
|
9686
|
-
if (!options.frameworkComponents) {
|
|
9687
|
-
options.frameworkComponents = {};
|
|
9688
|
-
}
|
|
9689
9691
|
this.paneview = new Paneview(this.element, {
|
|
9690
9692
|
// only allow paneview in the vertical orientation for now
|
|
9691
9693
|
orientation: exports.Orientation.VERTICAL,
|
|
@@ -9710,22 +9712,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9710
9712
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
9711
9713
|
}
|
|
9712
9714
|
addPanel(options) {
|
|
9713
|
-
var _a
|
|
9714
|
-
const body =
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
: undefined);
|
|
9715
|
+
var _a;
|
|
9716
|
+
const body = this.options.createComponent({
|
|
9717
|
+
id: options.id,
|
|
9718
|
+
name: options.component,
|
|
9719
|
+
});
|
|
9719
9720
|
let header;
|
|
9720
|
-
if (options.headerComponent) {
|
|
9721
|
-
header =
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
}
|
|
9726
|
-
: undefined);
|
|
9721
|
+
if (options.headerComponent && this.options.createHeaderComponent) {
|
|
9722
|
+
header = this.options.createHeaderComponent({
|
|
9723
|
+
id: options.id,
|
|
9724
|
+
name: options.headerComponent,
|
|
9725
|
+
});
|
|
9727
9726
|
}
|
|
9728
|
-
|
|
9727
|
+
if (!header) {
|
|
9729
9728
|
header = new DefaultHeader();
|
|
9730
9729
|
}
|
|
9731
9730
|
const view = new PaneFramework({
|
|
@@ -9743,7 +9742,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9743
9742
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
9744
9743
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
9745
9744
|
view.init({
|
|
9746
|
-
params: (
|
|
9745
|
+
params: (_a = options.params) !== null && _a !== void 0 ? _a : {},
|
|
9747
9746
|
minimumBodySize: options.minimumBodySize,
|
|
9748
9747
|
maximumBodySize: options.maximumBodySize,
|
|
9749
9748
|
isExpanded: options.isExpanded,
|
|
@@ -9808,24 +9807,20 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9808
9807
|
descriptor: {
|
|
9809
9808
|
size,
|
|
9810
9809
|
views: views.map((view) => {
|
|
9811
|
-
var _a, _b, _c, _d;
|
|
9812
9810
|
const data = view.data;
|
|
9813
|
-
const body =
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
}
|
|
9818
|
-
: undefined);
|
|
9811
|
+
const body = this.options.createComponent({
|
|
9812
|
+
id: data.id,
|
|
9813
|
+
name: data.component,
|
|
9814
|
+
});
|
|
9819
9815
|
let header;
|
|
9820
|
-
if (data.headerComponent
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
: undefined);
|
|
9816
|
+
if (data.headerComponent &&
|
|
9817
|
+
this.options.createHeaderComponent) {
|
|
9818
|
+
header = this.options.createHeaderComponent({
|
|
9819
|
+
id: data.id,
|
|
9820
|
+
name: data.headerComponent,
|
|
9821
|
+
});
|
|
9827
9822
|
}
|
|
9828
|
-
|
|
9823
|
+
if (!header) {
|
|
9829
9824
|
header = new DefaultHeader();
|
|
9830
9825
|
}
|
|
9831
9826
|
const panel = new PaneFramework({
|
|
@@ -9873,9 +9868,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9873
9868
|
this.paneview.dispose();
|
|
9874
9869
|
}
|
|
9875
9870
|
doAddPanel(panel) {
|
|
9876
|
-
const disposable = panel.onDidDrop((event) => {
|
|
9871
|
+
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
9877
9872
|
this._onDidDrop.fire(event);
|
|
9878
|
-
})
|
|
9873
|
+
}), panel.onUnhandledDragOverEvent((event) => {
|
|
9874
|
+
this._onUnhandledDragOverEvent.fire(event);
|
|
9875
|
+
}));
|
|
9879
9876
|
this._viewDisposables.set(panel.id, disposable);
|
|
9880
9877
|
}
|
|
9881
9878
|
doRemovePanel(panel) {
|
|
@@ -10158,7 +10155,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10158
10155
|
this._onDidBlur = new Emitter();
|
|
10159
10156
|
this.onDidBlur = this._onDidBlur.event;
|
|
10160
10157
|
this._element = document.createElement('div');
|
|
10161
|
-
this._element.className = '
|
|
10158
|
+
this._element.className = 'dv-react-part';
|
|
10162
10159
|
this._element.style.height = '100%';
|
|
10163
10160
|
this._element.style.width = '100%';
|
|
10164
10161
|
}
|
|
@@ -10196,7 +10193,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10196
10193
|
this.component = component;
|
|
10197
10194
|
this.reactPortalStore = reactPortalStore;
|
|
10198
10195
|
this._element = document.createElement('div');
|
|
10199
|
-
this._element.className = '
|
|
10196
|
+
this._element.className = 'dv-react-part';
|
|
10200
10197
|
this._element.style.height = '100%';
|
|
10201
10198
|
this._element.style.width = '100%';
|
|
10202
10199
|
}
|
|
@@ -10232,7 +10229,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10232
10229
|
this.component = component;
|
|
10233
10230
|
this.reactPortalStore = reactPortalStore;
|
|
10234
10231
|
this._element = document.createElement('div');
|
|
10235
|
-
this._element.className = '
|
|
10232
|
+
this._element.className = 'dv-react-part';
|
|
10236
10233
|
this._element.style.height = '100%';
|
|
10237
10234
|
this._element.style.width = '100%';
|
|
10238
10235
|
}
|
|
@@ -10274,7 +10271,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10274
10271
|
this._group = _group;
|
|
10275
10272
|
this.mutableDisposable = new MutableDisposable();
|
|
10276
10273
|
this._element = document.createElement('div');
|
|
10277
|
-
this._element.className = '
|
|
10274
|
+
this._element.className = 'dv-react-part';
|
|
10278
10275
|
this._element.style.height = '100%';
|
|
10279
10276
|
this._element.style.width = '100%';
|
|
10280
10277
|
}
|
|
@@ -10333,8 +10330,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10333
10330
|
: undefined;
|
|
10334
10331
|
}
|
|
10335
10332
|
const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
|
|
10336
|
-
function extractCoreOptions(props) {
|
|
10337
|
-
const coreOptions =
|
|
10333
|
+
function extractCoreOptions$3(props) {
|
|
10334
|
+
const coreOptions = PROPERTY_KEYS_DOCKVIEW.reduce((obj, key) => {
|
|
10338
10335
|
if (key in props) {
|
|
10339
10336
|
obj[key] = props[key];
|
|
10340
10337
|
}
|
|
@@ -10350,7 +10347,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10350
10347
|
const prevProps = React.useRef({});
|
|
10351
10348
|
React.useEffect(() => {
|
|
10352
10349
|
const changes = {};
|
|
10353
|
-
|
|
10350
|
+
PROPERTY_KEYS_DOCKVIEW.forEach((propKey) => {
|
|
10354
10351
|
const key = propKey;
|
|
10355
10352
|
const propValue = props[key];
|
|
10356
10353
|
if (key in props && propValue !== prevProps.current[key]) {
|
|
@@ -10361,7 +10358,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10361
10358
|
dockviewRef.current.updateOptions(changes);
|
|
10362
10359
|
}
|
|
10363
10360
|
prevProps.current = props;
|
|
10364
|
-
},
|
|
10361
|
+
}, PROPERTY_KEYS_DOCKVIEW.map((key) => props[key]));
|
|
10365
10362
|
React.useEffect(() => {
|
|
10366
10363
|
var _a;
|
|
10367
10364
|
if (!domRef.current) {
|
|
@@ -10397,7 +10394,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10397
10394
|
? DEFAULT_REACT_TAB
|
|
10398
10395
|
: undefined,
|
|
10399
10396
|
};
|
|
10400
|
-
const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
10397
|
+
const api = createDockview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$3(props)), frameworkOptions));
|
|
10401
10398
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10402
10399
|
api.layout(clientWidth, clientHeight);
|
|
10403
10400
|
if (props.onReady) {
|
|
@@ -10608,31 +10605,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10608
10605
|
}
|
|
10609
10606
|
}
|
|
10610
10607
|
|
|
10608
|
+
function extractCoreOptions$2(props) {
|
|
10609
|
+
const coreOptions = PROPERTY_KEYS_SPLITVIEW.reduce((obj, key) => {
|
|
10610
|
+
if (key in props) {
|
|
10611
|
+
obj[key] = props[key];
|
|
10612
|
+
}
|
|
10613
|
+
return obj;
|
|
10614
|
+
}, {});
|
|
10615
|
+
return coreOptions;
|
|
10616
|
+
}
|
|
10611
10617
|
const SplitviewReact = React.forwardRef((props, ref) => {
|
|
10612
10618
|
const domRef = React.useRef(null);
|
|
10613
10619
|
const splitviewRef = React.useRef();
|
|
10614
10620
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10615
10621
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10622
|
+
const prevProps = React.useRef({});
|
|
10616
10623
|
React.useEffect(() => {
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
return new ReactPanelView(id, componentId, component, {
|
|
10625
|
-
addPortal,
|
|
10626
|
-
});
|
|
10627
|
-
},
|
|
10628
|
-
},
|
|
10629
|
-
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
10630
|
-
? props.proportionalLayout
|
|
10631
|
-
: true,
|
|
10632
|
-
styles: props.hideBorders
|
|
10633
|
-
? { separatorBorder: 'transparent' }
|
|
10634
|
-
: undefined,
|
|
10624
|
+
const changes = {};
|
|
10625
|
+
PROPERTY_KEYS_SPLITVIEW.forEach((propKey) => {
|
|
10626
|
+
const key = propKey;
|
|
10627
|
+
const propValue = props[key];
|
|
10628
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10629
|
+
changes[key] = propValue;
|
|
10630
|
+
}
|
|
10635
10631
|
});
|
|
10632
|
+
if (splitviewRef.current) {
|
|
10633
|
+
splitviewRef.current.updateOptions(changes);
|
|
10634
|
+
}
|
|
10635
|
+
prevProps.current = props;
|
|
10636
|
+
}, PROPERTY_KEYS_SPLITVIEW.map((key) => props[key]));
|
|
10637
|
+
React.useEffect(() => {
|
|
10638
|
+
if (!domRef.current) {
|
|
10639
|
+
return () => {
|
|
10640
|
+
// noop
|
|
10641
|
+
};
|
|
10642
|
+
}
|
|
10643
|
+
const frameworkOptions = {
|
|
10644
|
+
createComponent: (options) => {
|
|
10645
|
+
return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10646
|
+
},
|
|
10647
|
+
};
|
|
10648
|
+
const api = createSplitview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$2(props)), frameworkOptions));
|
|
10636
10649
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10637
10650
|
api.layout(clientWidth, clientHeight);
|
|
10638
10651
|
if (props.onReady) {
|
|
@@ -10648,7 +10661,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10648
10661
|
return;
|
|
10649
10662
|
}
|
|
10650
10663
|
splitviewRef.current.updateOptions({
|
|
10651
|
-
|
|
10664
|
+
createComponent: (options) => {
|
|
10665
|
+
return new ReactPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10666
|
+
},
|
|
10652
10667
|
});
|
|
10653
10668
|
}, [props.components]);
|
|
10654
10669
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
@@ -10673,36 +10688,47 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10673
10688
|
}
|
|
10674
10689
|
}
|
|
10675
10690
|
|
|
10691
|
+
function extractCoreOptions$1(props) {
|
|
10692
|
+
const coreOptions = PROPERTY_KEYS_GRIDVIEW.reduce((obj, key) => {
|
|
10693
|
+
if (key in props) {
|
|
10694
|
+
obj[key] = props[key];
|
|
10695
|
+
}
|
|
10696
|
+
return obj;
|
|
10697
|
+
}, {});
|
|
10698
|
+
return coreOptions;
|
|
10699
|
+
}
|
|
10676
10700
|
const GridviewReact = React.forwardRef((props, ref) => {
|
|
10677
10701
|
const domRef = React.useRef(null);
|
|
10678
10702
|
const gridviewRef = React.useRef();
|
|
10679
10703
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10680
10704
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10705
|
+
const prevProps = React.useRef({});
|
|
10706
|
+
React.useEffect(() => {
|
|
10707
|
+
const changes = {};
|
|
10708
|
+
PROPERTY_KEYS_GRIDVIEW.forEach((propKey) => {
|
|
10709
|
+
const key = propKey;
|
|
10710
|
+
const propValue = props[key];
|
|
10711
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10712
|
+
changes[key] = propValue;
|
|
10713
|
+
}
|
|
10714
|
+
});
|
|
10715
|
+
if (gridviewRef.current) {
|
|
10716
|
+
gridviewRef.current.updateOptions(changes);
|
|
10717
|
+
}
|
|
10718
|
+
prevProps.current = props;
|
|
10719
|
+
}, PROPERTY_KEYS_GRIDVIEW.map((key) => props[key]));
|
|
10681
10720
|
React.useEffect(() => {
|
|
10682
|
-
var _a;
|
|
10683
10721
|
if (!domRef.current) {
|
|
10684
10722
|
return () => {
|
|
10685
10723
|
// noop
|
|
10686
10724
|
};
|
|
10687
10725
|
}
|
|
10688
|
-
const
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
? props.proportionalLayout
|
|
10692
|
-
: true,
|
|
10693
|
-
orientation: (_a = props.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.HORIZONTAL,
|
|
10694
|
-
frameworkComponents: props.components,
|
|
10695
|
-
frameworkComponentFactory: {
|
|
10696
|
-
createComponent: (id, componentId, component) => {
|
|
10697
|
-
return new ReactGridPanelView(id, componentId, component, {
|
|
10698
|
-
addPortal,
|
|
10699
|
-
});
|
|
10700
|
-
},
|
|
10726
|
+
const frameworkOptions = {
|
|
10727
|
+
createComponent: (options) => {
|
|
10728
|
+
return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10701
10729
|
},
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
: undefined,
|
|
10705
|
-
});
|
|
10730
|
+
};
|
|
10731
|
+
const api = createGridview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions$1(props)), frameworkOptions));
|
|
10706
10732
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10707
10733
|
api.layout(clientWidth, clientHeight);
|
|
10708
10734
|
if (props.onReady) {
|
|
@@ -10718,7 +10744,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10718
10744
|
return;
|
|
10719
10745
|
}
|
|
10720
10746
|
gridviewRef.current.updateOptions({
|
|
10721
|
-
|
|
10747
|
+
createComponent: (options) => {
|
|
10748
|
+
return new ReactGridPanelView(options.id, options.name, props.components[options.name], { addPortal });
|
|
10749
|
+
},
|
|
10722
10750
|
});
|
|
10723
10751
|
}, [props.components]);
|
|
10724
10752
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
@@ -10760,32 +10788,52 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10760
10788
|
}
|
|
10761
10789
|
}
|
|
10762
10790
|
|
|
10791
|
+
function extractCoreOptions(props) {
|
|
10792
|
+
const coreOptions = PROPERTY_KEYS_PANEVIEW.reduce((obj, key) => {
|
|
10793
|
+
if (key in props) {
|
|
10794
|
+
obj[key] = props[key];
|
|
10795
|
+
}
|
|
10796
|
+
return obj;
|
|
10797
|
+
}, {});
|
|
10798
|
+
return coreOptions;
|
|
10799
|
+
}
|
|
10763
10800
|
const PaneviewReact = React.forwardRef((props, ref) => {
|
|
10764
10801
|
const domRef = React.useRef(null);
|
|
10765
10802
|
const paneviewRef = React.useRef();
|
|
10766
10803
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
10767
10804
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
10805
|
+
const prevProps = React.useRef({});
|
|
10768
10806
|
React.useEffect(() => {
|
|
10769
|
-
const
|
|
10770
|
-
|
|
10807
|
+
const changes = {};
|
|
10808
|
+
PROPERTY_KEYS_PANEVIEW.forEach((propKey) => {
|
|
10809
|
+
const key = propKey;
|
|
10810
|
+
const propValue = props[key];
|
|
10811
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
10812
|
+
changes[key] = propValue;
|
|
10813
|
+
}
|
|
10771
10814
|
});
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10815
|
+
if (paneviewRef.current) {
|
|
10816
|
+
paneviewRef.current.updateOptions(changes);
|
|
10817
|
+
}
|
|
10818
|
+
prevProps.current = props;
|
|
10819
|
+
}, PROPERTY_KEYS_PANEVIEW.map((key) => props[key]));
|
|
10820
|
+
React.useEffect(() => {
|
|
10821
|
+
var _a;
|
|
10822
|
+
if (!domRef.current) {
|
|
10823
|
+
return () => {
|
|
10824
|
+
// noop
|
|
10825
|
+
};
|
|
10826
|
+
}
|
|
10827
|
+
const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
10828
|
+
const frameworkOptions = {
|
|
10829
|
+
createComponent: (options) => {
|
|
10830
|
+
return new PanePanelSection(options.id, props.components[options.name], { addPortal });
|
|
10786
10831
|
},
|
|
10787
|
-
|
|
10788
|
-
|
|
10832
|
+
createHeaderComponent: (options) => {
|
|
10833
|
+
return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
|
|
10834
|
+
},
|
|
10835
|
+
};
|
|
10836
|
+
const api = createPaneview(domRef.current, Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
10789
10837
|
const { clientWidth, clientHeight } = domRef.current;
|
|
10790
10838
|
api.layout(clientWidth, clientHeight);
|
|
10791
10839
|
if (props.onReady) {
|
|
@@ -10801,41 +10849,38 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10801
10849
|
return;
|
|
10802
10850
|
}
|
|
10803
10851
|
paneviewRef.current.updateOptions({
|
|
10804
|
-
|
|
10852
|
+
createComponent: (options) => {
|
|
10853
|
+
return new PanePanelSection(options.id, props.components[options.name], { addPortal });
|
|
10854
|
+
},
|
|
10805
10855
|
});
|
|
10806
10856
|
}, [props.components]);
|
|
10807
10857
|
React.useEffect(() => {
|
|
10858
|
+
var _a;
|
|
10808
10859
|
if (!paneviewRef.current) {
|
|
10809
10860
|
return;
|
|
10810
10861
|
}
|
|
10862
|
+
const headerComponents = (_a = props.headerComponents) !== null && _a !== void 0 ? _a : {};
|
|
10811
10863
|
paneviewRef.current.updateOptions({
|
|
10812
|
-
|
|
10864
|
+
createHeaderComponent: (options) => {
|
|
10865
|
+
return new PanePanelSection(options.id, headerComponents[options.name], { addPortal });
|
|
10866
|
+
},
|
|
10813
10867
|
});
|
|
10814
10868
|
}, [props.headerComponents]);
|
|
10815
10869
|
React.useEffect(() => {
|
|
10816
10870
|
if (!paneviewRef.current) {
|
|
10817
10871
|
return () => {
|
|
10818
|
-
//
|
|
10872
|
+
// noop
|
|
10819
10873
|
};
|
|
10820
10874
|
}
|
|
10821
|
-
const
|
|
10822
|
-
const disposable = api.onDidDrop((event) => {
|
|
10875
|
+
const disposable = paneviewRef.current.onDidDrop((event) => {
|
|
10823
10876
|
if (props.onDidDrop) {
|
|
10824
|
-
props.onDidDrop(
|
|
10877
|
+
props.onDidDrop(event);
|
|
10825
10878
|
}
|
|
10826
10879
|
});
|
|
10827
10880
|
return () => {
|
|
10828
10881
|
disposable.dispose();
|
|
10829
10882
|
};
|
|
10830
10883
|
}, [props.onDidDrop]);
|
|
10831
|
-
React.useEffect(() => {
|
|
10832
|
-
if (!paneviewRef.current) {
|
|
10833
|
-
return;
|
|
10834
|
-
}
|
|
10835
|
-
paneviewRef.current.updateOptions({
|
|
10836
|
-
showDndOverlay: props.showDndOverlay,
|
|
10837
|
-
});
|
|
10838
|
-
}, [props.showDndOverlay]);
|
|
10839
10884
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
10840
10885
|
});
|
|
10841
10886
|
PaneviewReact.displayName = 'PaneviewComponent';
|
|
@@ -10863,7 +10908,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10863
10908
|
exports.GridviewComponent = GridviewComponent;
|
|
10864
10909
|
exports.GridviewPanel = GridviewPanel;
|
|
10865
10910
|
exports.GridviewReact = GridviewReact;
|
|
10866
|
-
exports.
|
|
10911
|
+
exports.PROPERTY_KEYS_DOCKVIEW = PROPERTY_KEYS_DOCKVIEW;
|
|
10912
|
+
exports.PROPERTY_KEYS_GRIDVIEW = PROPERTY_KEYS_GRIDVIEW;
|
|
10913
|
+
exports.PROPERTY_KEYS_PANEVIEW = PROPERTY_KEYS_PANEVIEW;
|
|
10914
|
+
exports.PROPERTY_KEYS_SPLITVIEW = PROPERTY_KEYS_SPLITVIEW;
|
|
10867
10915
|
exports.PaneFramework = PaneFramework;
|
|
10868
10916
|
exports.PaneTransfer = PaneTransfer;
|
|
10869
10917
|
exports.PanelTransfer = PanelTransfer;
|
|
@@ -10872,6 +10920,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10872
10920
|
exports.PaneviewComponent = PaneviewComponent;
|
|
10873
10921
|
exports.PaneviewPanel = PaneviewPanel;
|
|
10874
10922
|
exports.PaneviewReact = PaneviewReact;
|
|
10923
|
+
exports.PaneviewUnhandledDragOverEvent = PaneviewUnhandledDragOverEvent;
|
|
10875
10924
|
exports.ReactPart = ReactPart;
|
|
10876
10925
|
exports.ReactPartContext = ReactPartContext;
|
|
10877
10926
|
exports.Splitview = Splitview;
|