dockview-core 3.0.1 → 3.1.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/api/dockviewGroupPanelApi.d.ts +1 -2
- package/dist/cjs/api/dockviewGroupPanelApi.js +1 -17
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -3
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +15 -6
- package/dist/cjs/dockview/dockviewComponent.d.ts +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +15 -2
- package/dist/cjs/dockview/dockviewGroupPanel.js +3 -0
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +4 -2
- package/dist/cjs/gridview/gridviewComponent.d.ts +1 -1
- package/dist/cjs/gridview/gridviewComponent.js +2 -2
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -1
- package/dist/cjs/paneview/paneviewComponent.js +6 -2
- package/dist/cjs/splitview/splitview.d.ts +1 -1
- package/dist/cjs/splitview/splitview.js +3 -3
- package/dist/cjs/splitview/splitviewComponent.d.ts +1 -1
- package/dist/cjs/splitview/splitviewComponent.js +6 -2
- package/dist/dockview-core.amd.js +57 -39
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +56 -38
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +57 -39
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +57 -39
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +57 -39
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +56 -38
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +1 -2
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -16
- package/dist/esm/dockview/components/tab/defaultTab.js +0 -3
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +15 -6
- package/dist/esm/dockview/dockviewComponent.d.ts +1 -1
- package/dist/esm/dockview/dockviewComponent.js +15 -2
- package/dist/esm/dockview/dockviewGroupPanel.js +3 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +4 -2
- package/dist/esm/gridview/gridviewComponent.d.ts +1 -1
- package/dist/esm/gridview/gridviewComponent.js +2 -2
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -1
- package/dist/esm/paneview/paneviewComponent.js +6 -2
- package/dist/esm/splitview/splitview.d.ts +1 -1
- package/dist/esm/splitview/splitview.js +3 -3
- package/dist/esm/splitview/splitviewComponent.d.ts +1 -1
- package/dist/esm/splitview/splitviewComponent.js +6 -2
- package/dist/styles/dockview.css +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 3.0
|
|
3
|
+
* @version 3.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
this._margin = value;
|
|
855
855
|
}
|
|
856
856
|
constructor(container, options) {
|
|
857
|
-
var _a;
|
|
857
|
+
var _a, _b;
|
|
858
858
|
this.container = container;
|
|
859
859
|
this.viewItems = [];
|
|
860
860
|
this.sashes = [];
|
|
@@ -952,9 +952,9 @@
|
|
|
952
952
|
//
|
|
953
953
|
return delta;
|
|
954
954
|
};
|
|
955
|
-
this._orientation = options.orientation;
|
|
955
|
+
this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
|
|
956
956
|
this.element = this.createContainer();
|
|
957
|
-
this.margin = (
|
|
957
|
+
this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
|
|
958
958
|
this.proportionalLayout =
|
|
959
959
|
options.proportionalLayout === undefined
|
|
960
960
|
? true
|
|
@@ -2773,9 +2773,9 @@
|
|
|
2773
2773
|
set locked(value) {
|
|
2774
2774
|
this.gridview.locked = value;
|
|
2775
2775
|
}
|
|
2776
|
-
constructor(
|
|
2776
|
+
constructor(container, options) {
|
|
2777
2777
|
var _a;
|
|
2778
|
-
super(
|
|
2778
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
2779
2779
|
this._id = nextLayoutId$1.next();
|
|
2780
2780
|
this._groups = new Map();
|
|
2781
2781
|
this._onDidRemove = new Emitter();
|
|
@@ -2794,6 +2794,8 @@
|
|
|
2794
2794
|
this.element.style.width = '100%';
|
|
2795
2795
|
this._classNames = new Classnames(this.element);
|
|
2796
2796
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2797
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
2798
|
+
container.appendChild(this.element);
|
|
2797
2799
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2798
2800
|
this.gridview.locked = !!options.locked;
|
|
2799
2801
|
this.element.appendChild(this.gridview.element);
|
|
@@ -5059,6 +5061,9 @@
|
|
|
5059
5061
|
delete(id) {
|
|
5060
5062
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5061
5063
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
5064
|
+
if (!tabToRemove) {
|
|
5065
|
+
throw new Error(`dockview: Tab not found`);
|
|
5066
|
+
}
|
|
5062
5067
|
const { value, disposable } = tabToRemove;
|
|
5063
5068
|
disposable.dispose();
|
|
5064
5069
|
value.dispose();
|
|
@@ -5080,6 +5085,9 @@
|
|
|
5080
5085
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
5081
5086
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
5082
5087
|
}), tab.onChanged((event) => {
|
|
5088
|
+
if (event.defaultPrevented) {
|
|
5089
|
+
return;
|
|
5090
|
+
}
|
|
5083
5091
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
5084
5092
|
const isFloatingWithOnePanel = this.group.api.location.type === 'floating' &&
|
|
5085
5093
|
this.size === 1;
|
|
@@ -5097,12 +5105,15 @@
|
|
|
5097
5105
|
});
|
|
5098
5106
|
return;
|
|
5099
5107
|
}
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5108
|
+
switch (event.button) {
|
|
5109
|
+
case 0: // left click or touch
|
|
5110
|
+
if (this.group.activePanel !== panel) {
|
|
5111
|
+
this.group.model.openPanel(panel);
|
|
5112
|
+
}
|
|
5113
|
+
break;
|
|
5114
|
+
case 1: // middle click
|
|
5115
|
+
panel.api.close();
|
|
5116
|
+
break;
|
|
5106
5117
|
}
|
|
5107
5118
|
}), tab.onDrop((event) => {
|
|
5108
5119
|
this._onDrop.fire({
|
|
@@ -6052,12 +6063,11 @@
|
|
|
6052
6063
|
constructor(id, accessor) {
|
|
6053
6064
|
super(id, '__dockviewgroup__');
|
|
6054
6065
|
this.accessor = accessor;
|
|
6055
|
-
this._mutableDisposable = new MutableDisposable();
|
|
6056
6066
|
this._onDidLocationChange = new Emitter();
|
|
6057
6067
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6058
6068
|
this._onDidActivePanelChange = new Emitter();
|
|
6059
6069
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6060
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange
|
|
6070
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
|
|
6061
6071
|
}
|
|
6062
6072
|
close() {
|
|
6063
6073
|
if (!this._group) {
|
|
@@ -6115,20 +6125,7 @@
|
|
|
6115
6125
|
}
|
|
6116
6126
|
}
|
|
6117
6127
|
initialize(group) {
|
|
6118
|
-
/**
|
|
6119
|
-
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
6120
|
-
*
|
|
6121
|
-
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
6122
|
-
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
6123
|
-
* finished ensuring the `model` is defined.
|
|
6124
|
-
*/
|
|
6125
6128
|
this._group = group;
|
|
6126
|
-
queueMicrotask(() => {
|
|
6127
|
-
this._mutableDisposable.value =
|
|
6128
|
-
this._group.model.onDidActivePanelChange((event) => {
|
|
6129
|
-
this._onDidActivePanelChange.fire(event);
|
|
6130
|
-
});
|
|
6131
|
-
});
|
|
6132
6129
|
}
|
|
6133
6130
|
}
|
|
6134
6131
|
|
|
@@ -6198,6 +6195,9 @@
|
|
|
6198
6195
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
6199
6196
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
6200
6197
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
6198
|
+
this.addDisposables(this.model.onDidActivePanelChange((event) => {
|
|
6199
|
+
this.api._onDidActivePanelChange.fire(event);
|
|
6200
|
+
}));
|
|
6201
6201
|
}
|
|
6202
6202
|
focus() {
|
|
6203
6203
|
if (!this.api.isActive) {
|
|
@@ -6545,9 +6545,6 @@
|
|
|
6545
6545
|
this.action.appendChild(createCloseButton());
|
|
6546
6546
|
this._element.appendChild(this._content);
|
|
6547
6547
|
this._element.appendChild(this.action);
|
|
6548
|
-
this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
6549
|
-
ev.preventDefault();
|
|
6550
|
-
}));
|
|
6551
6548
|
this.render();
|
|
6552
6549
|
}
|
|
6553
6550
|
init(params) {
|
|
@@ -7513,9 +7510,9 @@
|
|
|
7513
7510
|
get floatingGroups() {
|
|
7514
7511
|
return this._floatingGroups;
|
|
7515
7512
|
}
|
|
7516
|
-
constructor(
|
|
7513
|
+
constructor(container, options) {
|
|
7517
7514
|
var _a;
|
|
7518
|
-
super(
|
|
7515
|
+
super(container, {
|
|
7519
7516
|
proportionalLayout: true,
|
|
7520
7517
|
orientation: exports.Orientation.HORIZONTAL,
|
|
7521
7518
|
styles: options.hideBorders
|
|
@@ -7852,6 +7849,9 @@
|
|
|
7852
7849
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7853
7850
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7854
7851
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7852
|
+
if (this.isDisposed) {
|
|
7853
|
+
return; // cleanup may run after instance is disposed
|
|
7854
|
+
}
|
|
7855
7855
|
if (isGroupAddedToDom &&
|
|
7856
7856
|
this.getPanel(referenceGroup.id)) {
|
|
7857
7857
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
@@ -7871,6 +7871,16 @@
|
|
|
7871
7871
|
group.model.renderContainer =
|
|
7872
7872
|
this.overlayRenderContainer;
|
|
7873
7873
|
returnedGroup = group;
|
|
7874
|
+
const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
|
|
7875
|
+
if (alreadyRemoved) {
|
|
7876
|
+
/**
|
|
7877
|
+
* If this popout group was explicitly removed then we shouldn't run the additional
|
|
7878
|
+
* steps. To tell if the running of this disposable is the result of this popout group
|
|
7879
|
+
* being explicitly removed we can check if this popout group is still referenced in
|
|
7880
|
+
* the `this._popoutGroups` list.
|
|
7881
|
+
*/
|
|
7882
|
+
return;
|
|
7883
|
+
}
|
|
7874
7884
|
if (floatingBox) {
|
|
7875
7885
|
this.addFloatingGroup(group, {
|
|
7876
7886
|
height: floatingBox.height,
|
|
@@ -9047,9 +9057,9 @@
|
|
|
9047
9057
|
set deserializer(value) {
|
|
9048
9058
|
this._deserializer = value;
|
|
9049
9059
|
}
|
|
9050
|
-
constructor(
|
|
9060
|
+
constructor(container, options) {
|
|
9051
9061
|
var _a;
|
|
9052
|
-
super(
|
|
9062
|
+
super(container, {
|
|
9053
9063
|
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9054
9064
|
orientation: options.orientation,
|
|
9055
9065
|
styles: options.hideBorders
|
|
@@ -9338,9 +9348,9 @@
|
|
|
9338
9348
|
? this.splitview.size
|
|
9339
9349
|
: this.splitview.orthogonalSize;
|
|
9340
9350
|
}
|
|
9341
|
-
constructor(
|
|
9351
|
+
constructor(container, options) {
|
|
9342
9352
|
var _a;
|
|
9343
|
-
super(
|
|
9353
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
9344
9354
|
this._splitviewChangeDisposable = new MutableDisposable();
|
|
9345
9355
|
this._panels = new Map();
|
|
9346
9356
|
this._onDidLayoutfromJSON = new Emitter();
|
|
@@ -9351,8 +9361,12 @@
|
|
|
9351
9361
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9352
9362
|
this._onDidLayoutChange = new Emitter();
|
|
9353
9363
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
9364
|
+
this.element.style.height = '100%';
|
|
9365
|
+
this.element.style.width = '100%';
|
|
9354
9366
|
this._classNames = new Classnames(this.element);
|
|
9355
9367
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9368
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
9369
|
+
container.appendChild(this.element);
|
|
9356
9370
|
this._options = options;
|
|
9357
9371
|
this.splitview = new Splitview(this.element, options);
|
|
9358
9372
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
@@ -9662,9 +9676,9 @@
|
|
|
9662
9676
|
get options() {
|
|
9663
9677
|
return this._options;
|
|
9664
9678
|
}
|
|
9665
|
-
constructor(
|
|
9679
|
+
constructor(container, options) {
|
|
9666
9680
|
var _a;
|
|
9667
|
-
super(
|
|
9681
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
9668
9682
|
this._id = nextLayoutId.next();
|
|
9669
9683
|
this._disposable = new MutableDisposable();
|
|
9670
9684
|
this._viewDisposables = new Map();
|
|
@@ -9680,9 +9694,13 @@
|
|
|
9680
9694
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9681
9695
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
9682
9696
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9697
|
+
this.element.style.height = '100%';
|
|
9698
|
+
this.element.style.width = '100%';
|
|
9683
9699
|
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9684
9700
|
this._classNames = new Classnames(this.element);
|
|
9685
9701
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9702
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
9703
|
+
container.appendChild(this.element);
|
|
9686
9704
|
this._options = options;
|
|
9687
9705
|
this.paneview = new Paneview(this.element, {
|
|
9688
9706
|
// only allow paneview in the vertical orientation for now
|