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
|
*/
|
|
@@ -850,7 +850,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
850
850
|
this._margin = value;
|
|
851
851
|
}
|
|
852
852
|
constructor(container, options) {
|
|
853
|
-
var _a;
|
|
853
|
+
var _a, _b;
|
|
854
854
|
this.container = container;
|
|
855
855
|
this.viewItems = [];
|
|
856
856
|
this.sashes = [];
|
|
@@ -948,9 +948,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
948
948
|
//
|
|
949
949
|
return delta;
|
|
950
950
|
};
|
|
951
|
-
this._orientation = options.orientation;
|
|
951
|
+
this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
|
|
952
952
|
this.element = this.createContainer();
|
|
953
|
-
this.margin = (
|
|
953
|
+
this.margin = (_b = options.margin) !== null && _b !== void 0 ? _b : 0;
|
|
954
954
|
this.proportionalLayout =
|
|
955
955
|
options.proportionalLayout === undefined
|
|
956
956
|
? true
|
|
@@ -2769,9 +2769,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2769
2769
|
set locked(value) {
|
|
2770
2770
|
this.gridview.locked = value;
|
|
2771
2771
|
}
|
|
2772
|
-
constructor(
|
|
2772
|
+
constructor(container, options) {
|
|
2773
2773
|
var _a;
|
|
2774
|
-
super(
|
|
2774
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
2775
2775
|
this._id = nextLayoutId$1.next();
|
|
2776
2776
|
this._groups = new Map();
|
|
2777
2777
|
this._onDidRemove = new Emitter();
|
|
@@ -2790,6 +2790,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2790
2790
|
this.element.style.width = '100%';
|
|
2791
2791
|
this._classNames = new Classnames(this.element);
|
|
2792
2792
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
2793
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
2794
|
+
container.appendChild(this.element);
|
|
2793
2795
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
2794
2796
|
this.gridview.locked = !!options.locked;
|
|
2795
2797
|
this.element.appendChild(this.gridview.element);
|
|
@@ -5055,6 +5057,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5055
5057
|
delete(id) {
|
|
5056
5058
|
const index = this.tabs.findIndex((tab) => tab.value.panel.id === id);
|
|
5057
5059
|
const tabToRemove = this.tabs.splice(index, 1)[0];
|
|
5060
|
+
if (!tabToRemove) {
|
|
5061
|
+
throw new Error(`dockview: Tab not found`);
|
|
5062
|
+
}
|
|
5058
5063
|
const { value, disposable } = tabToRemove;
|
|
5059
5064
|
disposable.dispose();
|
|
5060
5065
|
value.dispose();
|
|
@@ -5076,6 +5081,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5076
5081
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
5077
5082
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
5078
5083
|
}), tab.onChanged((event) => {
|
|
5084
|
+
if (event.defaultPrevented) {
|
|
5085
|
+
return;
|
|
5086
|
+
}
|
|
5079
5087
|
const isFloatingGroupsEnabled = !this.accessor.options.disableFloatingGroups;
|
|
5080
5088
|
const isFloatingWithOnePanel = this.group.api.location.type === 'floating' &&
|
|
5081
5089
|
this.size === 1;
|
|
@@ -5093,12 +5101,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5093
5101
|
});
|
|
5094
5102
|
return;
|
|
5095
5103
|
}
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5104
|
+
switch (event.button) {
|
|
5105
|
+
case 0: // left click or touch
|
|
5106
|
+
if (this.group.activePanel !== panel) {
|
|
5107
|
+
this.group.model.openPanel(panel);
|
|
5108
|
+
}
|
|
5109
|
+
break;
|
|
5110
|
+
case 1: // middle click
|
|
5111
|
+
panel.api.close();
|
|
5112
|
+
break;
|
|
5102
5113
|
}
|
|
5103
5114
|
}), tab.onDrop((event) => {
|
|
5104
5115
|
this._onDrop.fire({
|
|
@@ -6048,12 +6059,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6048
6059
|
constructor(id, accessor) {
|
|
6049
6060
|
super(id, '__dockviewgroup__');
|
|
6050
6061
|
this.accessor = accessor;
|
|
6051
|
-
this._mutableDisposable = new MutableDisposable();
|
|
6052
6062
|
this._onDidLocationChange = new Emitter();
|
|
6053
6063
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
6054
6064
|
this._onDidActivePanelChange = new Emitter();
|
|
6055
6065
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
6056
|
-
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange
|
|
6066
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange);
|
|
6057
6067
|
}
|
|
6058
6068
|
close() {
|
|
6059
6069
|
if (!this._group) {
|
|
@@ -6111,20 +6121,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6111
6121
|
}
|
|
6112
6122
|
}
|
|
6113
6123
|
initialize(group) {
|
|
6114
|
-
/**
|
|
6115
|
-
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
6116
|
-
*
|
|
6117
|
-
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
6118
|
-
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
6119
|
-
* finished ensuring the `model` is defined.
|
|
6120
|
-
*/
|
|
6121
6124
|
this._group = group;
|
|
6122
|
-
queueMicrotask(() => {
|
|
6123
|
-
this._mutableDisposable.value =
|
|
6124
|
-
this._group.model.onDidActivePanelChange((event) => {
|
|
6125
|
-
this._onDidActivePanelChange.fire(event);
|
|
6126
|
-
});
|
|
6127
|
-
});
|
|
6128
6125
|
}
|
|
6129
6126
|
}
|
|
6130
6127
|
|
|
@@ -6194,6 +6191,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6194
6191
|
}, new DockviewGroupPanelApiImpl(id, accessor));
|
|
6195
6192
|
this.api.initialize(this); // cannot use 'this' after after 'super' call
|
|
6196
6193
|
this._model = new DockviewGroupPanelModel(this.element, accessor, id, options, this);
|
|
6194
|
+
this.addDisposables(this.model.onDidActivePanelChange((event) => {
|
|
6195
|
+
this.api._onDidActivePanelChange.fire(event);
|
|
6196
|
+
}));
|
|
6197
6197
|
}
|
|
6198
6198
|
focus() {
|
|
6199
6199
|
if (!this.api.isActive) {
|
|
@@ -6541,9 +6541,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6541
6541
|
this.action.appendChild(createCloseButton());
|
|
6542
6542
|
this._element.appendChild(this._content);
|
|
6543
6543
|
this._element.appendChild(this.action);
|
|
6544
|
-
this.addDisposables(addDisposableListener(this.action, 'pointerdown', (ev) => {
|
|
6545
|
-
ev.preventDefault();
|
|
6546
|
-
}));
|
|
6547
6544
|
this.render();
|
|
6548
6545
|
}
|
|
6549
6546
|
init(params) {
|
|
@@ -7509,9 +7506,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7509
7506
|
get floatingGroups() {
|
|
7510
7507
|
return this._floatingGroups;
|
|
7511
7508
|
}
|
|
7512
|
-
constructor(
|
|
7509
|
+
constructor(container, options) {
|
|
7513
7510
|
var _a;
|
|
7514
|
-
super(
|
|
7511
|
+
super(container, {
|
|
7515
7512
|
proportionalLayout: true,
|
|
7516
7513
|
orientation: exports.Orientation.HORIZONTAL,
|
|
7517
7514
|
styles: options.hideBorders
|
|
@@ -7848,6 +7845,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7848
7845
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7849
7846
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7850
7847
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7848
|
+
if (this.isDisposed) {
|
|
7849
|
+
return; // cleanup may run after instance is disposed
|
|
7850
|
+
}
|
|
7851
7851
|
if (isGroupAddedToDom &&
|
|
7852
7852
|
this.getPanel(referenceGroup.id)) {
|
|
7853
7853
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
@@ -7867,6 +7867,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7867
7867
|
group.model.renderContainer =
|
|
7868
7868
|
this.overlayRenderContainer;
|
|
7869
7869
|
returnedGroup = group;
|
|
7870
|
+
const alreadyRemoved = !this._popoutGroups.find((p) => p.popoutGroup === group);
|
|
7871
|
+
if (alreadyRemoved) {
|
|
7872
|
+
/**
|
|
7873
|
+
* If this popout group was explicitly removed then we shouldn't run the additional
|
|
7874
|
+
* steps. To tell if the running of this disposable is the result of this popout group
|
|
7875
|
+
* being explicitly removed we can check if this popout group is still referenced in
|
|
7876
|
+
* the `this._popoutGroups` list.
|
|
7877
|
+
*/
|
|
7878
|
+
return;
|
|
7879
|
+
}
|
|
7870
7880
|
if (floatingBox) {
|
|
7871
7881
|
this.addFloatingGroup(group, {
|
|
7872
7882
|
height: floatingBox.height,
|
|
@@ -9043,9 +9053,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9043
9053
|
set deserializer(value) {
|
|
9044
9054
|
this._deserializer = value;
|
|
9045
9055
|
}
|
|
9046
|
-
constructor(
|
|
9056
|
+
constructor(container, options) {
|
|
9047
9057
|
var _a;
|
|
9048
|
-
super(
|
|
9058
|
+
super(container, {
|
|
9049
9059
|
proportionalLayout: (_a = options.proportionalLayout) !== null && _a !== void 0 ? _a : true,
|
|
9050
9060
|
orientation: options.orientation,
|
|
9051
9061
|
styles: options.hideBorders
|
|
@@ -9334,9 +9344,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9334
9344
|
? this.splitview.size
|
|
9335
9345
|
: this.splitview.orthogonalSize;
|
|
9336
9346
|
}
|
|
9337
|
-
constructor(
|
|
9347
|
+
constructor(container, options) {
|
|
9338
9348
|
var _a;
|
|
9339
|
-
super(
|
|
9349
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
9340
9350
|
this._splitviewChangeDisposable = new MutableDisposable();
|
|
9341
9351
|
this._panels = new Map();
|
|
9342
9352
|
this._onDidLayoutfromJSON = new Emitter();
|
|
@@ -9347,8 +9357,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9347
9357
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9348
9358
|
this._onDidLayoutChange = new Emitter();
|
|
9349
9359
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
9360
|
+
this.element.style.height = '100%';
|
|
9361
|
+
this.element.style.width = '100%';
|
|
9350
9362
|
this._classNames = new Classnames(this.element);
|
|
9351
9363
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9364
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
9365
|
+
container.appendChild(this.element);
|
|
9352
9366
|
this._options = options;
|
|
9353
9367
|
this.splitview = new Splitview(this.element, options);
|
|
9354
9368
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
@@ -9658,9 +9672,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9658
9672
|
get options() {
|
|
9659
9673
|
return this._options;
|
|
9660
9674
|
}
|
|
9661
|
-
constructor(
|
|
9675
|
+
constructor(container, options) {
|
|
9662
9676
|
var _a;
|
|
9663
|
-
super(
|
|
9677
|
+
super(document.createElement('div'), options.disableAutoResizing);
|
|
9664
9678
|
this._id = nextLayoutId.next();
|
|
9665
9679
|
this._disposable = new MutableDisposable();
|
|
9666
9680
|
this._viewDisposables = new Map();
|
|
@@ -9676,9 +9690,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9676
9690
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
9677
9691
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
9678
9692
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
9693
|
+
this.element.style.height = '100%';
|
|
9694
|
+
this.element.style.width = '100%';
|
|
9679
9695
|
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOverEvent);
|
|
9680
9696
|
this._classNames = new Classnames(this.element);
|
|
9681
9697
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
9698
|
+
// the container is owned by the third-party, do not modify/delete it
|
|
9699
|
+
container.appendChild(this.element);
|
|
9682
9700
|
this._options = options;
|
|
9683
9701
|
this.paneview = new Paneview(this.element, {
|
|
9684
9702
|
// only allow paneview in the vertical orientation for now
|