dockview-core 4.3.1 → 4.4.1
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/component.api.d.ts +1 -0
- package/dist/cjs/api/component.api.js +7 -0
- package/dist/cjs/dockview/components/tab/tab.d.ts +1 -0
- package/dist/cjs/dockview/components/tab/tab.js +4 -1
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +1 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +16 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +2 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +4 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +4 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -0
- package/dist/cjs/dockview/dockviewComponent.js +81 -42
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +10 -8
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +3 -0
- package/dist/dockview-core.amd.js +61 -14
- 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 +61 -14
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +61 -14
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +61 -14
- 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 +61 -14
- 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 +61 -14
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +1 -0
- package/dist/esm/api/component.api.js +3 -0
- package/dist/esm/dockview/components/tab/tab.d.ts +1 -0
- package/dist/esm/dockview/components/tab/tab.js +4 -1
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +1 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +5 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +4 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.js +4 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +4 -0
- package/dist/esm/dockview/dockviewComponent.js +37 -11
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +10 -8
- package/dist/esm/dockview/dockviewGroupPanelModel.js +3 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.4.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -3622,6 +3622,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3622
3622
|
get onDidPopoutGroupPositionChange() {
|
|
3623
3623
|
return this.component.onDidPopoutGroupPositionChange;
|
|
3624
3624
|
}
|
|
3625
|
+
get onDidOpenPopoutWindowFail() {
|
|
3626
|
+
return this.component.onDidOpenPopoutWindowFail;
|
|
3627
|
+
}
|
|
3625
3628
|
/**
|
|
3626
3629
|
* All panel objects.
|
|
3627
3630
|
*/
|
|
@@ -4990,7 +4993,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4990
4993
|
this._element = document.createElement('div');
|
|
4991
4994
|
this._element.className = 'dv-tab';
|
|
4992
4995
|
this._element.tabIndex = 0;
|
|
4993
|
-
this._element.draggable =
|
|
4996
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
4994
4997
|
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
4995
4998
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
4996
4999
|
this.dropTarget = new Droptarget(this._element, {
|
|
@@ -5038,6 +5041,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5038
5041
|
this.content = part;
|
|
5039
5042
|
this._element.appendChild(this.content.element);
|
|
5040
5043
|
}
|
|
5044
|
+
updateDragAndDropState() {
|
|
5045
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5046
|
+
}
|
|
5041
5047
|
dispose() {
|
|
5042
5048
|
super.dispose();
|
|
5043
5049
|
}
|
|
@@ -5109,7 +5115,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5109
5115
|
this.onDragStart = this._onDragStart.event;
|
|
5110
5116
|
this._element = document.createElement('div');
|
|
5111
5117
|
this._element.className = 'dv-void-container';
|
|
5112
|
-
this._element.draggable =
|
|
5118
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5113
5119
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5114
5120
|
this.accessor.doSetGroupActive(this.group);
|
|
5115
5121
|
}));
|
|
@@ -5132,6 +5138,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5132
5138
|
this._onDrop.fire(event);
|
|
5133
5139
|
}), this.dropTarget);
|
|
5134
5140
|
}
|
|
5141
|
+
updateDragAndDropState() {
|
|
5142
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5143
|
+
}
|
|
5135
5144
|
}
|
|
5136
5145
|
|
|
5137
5146
|
class Scrollbar extends CompositeDisposable {
|
|
@@ -5392,6 +5401,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5392
5401
|
.map((x) => x.value.panel.id);
|
|
5393
5402
|
this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
|
|
5394
5403
|
}
|
|
5404
|
+
updateDragAndDropState() {
|
|
5405
|
+
for (const tab of this._tabs) {
|
|
5406
|
+
tab.value.updateDragAndDropState();
|
|
5407
|
+
}
|
|
5408
|
+
}
|
|
5395
5409
|
}
|
|
5396
5410
|
|
|
5397
5411
|
const createSvgElementFromPath = (params) => {
|
|
@@ -5664,6 +5678,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5664
5678
|
});
|
|
5665
5679
|
}));
|
|
5666
5680
|
}
|
|
5681
|
+
updateDragAndDropState() {
|
|
5682
|
+
this.tabs.updateDragAndDropState();
|
|
5683
|
+
this.voidContainer.updateDragAndDropState();
|
|
5684
|
+
}
|
|
5667
5685
|
}
|
|
5668
5686
|
|
|
5669
5687
|
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
@@ -6369,6 +6387,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6369
6387
|
}));
|
|
6370
6388
|
}
|
|
6371
6389
|
}
|
|
6390
|
+
updateDragAndDropState() {
|
|
6391
|
+
this.tabsContainer.updateDragAndDropState();
|
|
6392
|
+
}
|
|
6372
6393
|
dispose() {
|
|
6373
6394
|
var _a, _b, _c;
|
|
6374
6395
|
super.dispose();
|
|
@@ -8224,6 +8245,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8224
8245
|
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8225
8246
|
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8226
8247
|
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8248
|
+
this._onDidOpenPopoutWindowFail = new Emitter();
|
|
8249
|
+
this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
|
|
8227
8250
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8228
8251
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8229
8252
|
this._onDidActivePanelChange = new Emitter({ replay: true });
|
|
@@ -8288,7 +8311,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8288
8311
|
if (options.debug) {
|
|
8289
8312
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8290
8313
|
}
|
|
8291
|
-
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8314
|
+
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8292
8315
|
this.updateWatermark();
|
|
8293
8316
|
}), this.onDidAdd((event) => {
|
|
8294
8317
|
if (!this._moving) {
|
|
@@ -8434,13 +8457,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8434
8457
|
if (_window.isDisposed) {
|
|
8435
8458
|
return false;
|
|
8436
8459
|
}
|
|
8437
|
-
if (popoutContainer === null) {
|
|
8438
|
-
popoutWindowDisposable.dispose();
|
|
8439
|
-
return false;
|
|
8440
|
-
}
|
|
8441
|
-
const gready = document.createElement('div');
|
|
8442
|
-
gready.className = 'dv-overlay-render-container';
|
|
8443
|
-
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8444
8460
|
const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
|
|
8445
8461
|
? options.referenceGroup
|
|
8446
8462
|
: itemToPopout instanceof DockviewPanel
|
|
@@ -8448,7 +8464,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8448
8464
|
: itemToPopout;
|
|
8449
8465
|
const referenceLocation = itemToPopout.api.location.type;
|
|
8450
8466
|
/**
|
|
8451
|
-
* The group that is being added doesn't already exist within the DOM, the most likely
|
|
8467
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurrence
|
|
8452
8468
|
* of this case is when being called from the `fromJSON(...)` method
|
|
8453
8469
|
*/
|
|
8454
8470
|
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
@@ -8461,8 +8477,28 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8461
8477
|
}
|
|
8462
8478
|
else {
|
|
8463
8479
|
group = this.createGroup({ id: groupId });
|
|
8464
|
-
|
|
8480
|
+
if (popoutContainer) {
|
|
8481
|
+
this._onDidAddGroup.fire(group);
|
|
8482
|
+
}
|
|
8483
|
+
}
|
|
8484
|
+
if (popoutContainer === null) {
|
|
8485
|
+
console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
|
|
8486
|
+
popoutWindowDisposable.dispose();
|
|
8487
|
+
this._onDidOpenPopoutWindowFail.fire();
|
|
8488
|
+
// if the popout window was blocked, we need to move the group back to the reference group
|
|
8489
|
+
// and set it to visible
|
|
8490
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
8491
|
+
from: group,
|
|
8492
|
+
to: referenceGroup,
|
|
8493
|
+
}));
|
|
8494
|
+
if (!referenceGroup.api.isVisible) {
|
|
8495
|
+
referenceGroup.api.setVisible(true);
|
|
8496
|
+
}
|
|
8497
|
+
return false;
|
|
8465
8498
|
}
|
|
8499
|
+
const gready = document.createElement('div');
|
|
8500
|
+
gready.className = 'dv-overlay-render-container';
|
|
8501
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8466
8502
|
group.model.renderContainer = overlayRenderContainer;
|
|
8467
8503
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8468
8504
|
let floatingBox;
|
|
@@ -8619,7 +8655,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8619
8655
|
return true;
|
|
8620
8656
|
})
|
|
8621
8657
|
.catch((err) => {
|
|
8622
|
-
console.error('dockview: failed to create popout
|
|
8658
|
+
console.error('dockview: failed to create popout.', err);
|
|
8623
8659
|
return false;
|
|
8624
8660
|
});
|
|
8625
8661
|
}
|
|
@@ -8826,7 +8862,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8826
8862
|
}
|
|
8827
8863
|
}
|
|
8828
8864
|
this.updateDropTargetModel(options);
|
|
8865
|
+
const oldDisableDnd = this.options.disableDnd;
|
|
8829
8866
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
8867
|
+
const newDisableDnd = this.options.disableDnd;
|
|
8868
|
+
if (oldDisableDnd !== newDisableDnd) {
|
|
8869
|
+
this.updateDragAndDropState();
|
|
8870
|
+
}
|
|
8830
8871
|
if ('theme' in options) {
|
|
8831
8872
|
this.updateTheme();
|
|
8832
8873
|
}
|
|
@@ -8841,6 +8882,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8841
8882
|
}
|
|
8842
8883
|
}
|
|
8843
8884
|
}
|
|
8885
|
+
updateDragAndDropState() {
|
|
8886
|
+
// Update draggable state for all tabs and void containers
|
|
8887
|
+
for (const group of this.groups) {
|
|
8888
|
+
group.model.updateDragAndDropState();
|
|
8889
|
+
}
|
|
8890
|
+
}
|
|
8844
8891
|
focus() {
|
|
8845
8892
|
var _a;
|
|
8846
8893
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|