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
|
*/
|
|
@@ -3650,6 +3650,9 @@ class DockviewApi {
|
|
|
3650
3650
|
get onDidPopoutGroupPositionChange() {
|
|
3651
3651
|
return this.component.onDidPopoutGroupPositionChange;
|
|
3652
3652
|
}
|
|
3653
|
+
get onDidOpenPopoutWindowFail() {
|
|
3654
|
+
return this.component.onDidOpenPopoutWindowFail;
|
|
3655
|
+
}
|
|
3653
3656
|
/**
|
|
3654
3657
|
* All panel objects.
|
|
3655
3658
|
*/
|
|
@@ -5018,7 +5021,7 @@ class Tab extends CompositeDisposable {
|
|
|
5018
5021
|
this._element = document.createElement('div');
|
|
5019
5022
|
this._element.className = 'dv-tab';
|
|
5020
5023
|
this._element.tabIndex = 0;
|
|
5021
|
-
this._element.draggable =
|
|
5024
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5022
5025
|
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
5023
5026
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
5024
5027
|
this.dropTarget = new Droptarget(this._element, {
|
|
@@ -5066,6 +5069,9 @@ class Tab extends CompositeDisposable {
|
|
|
5066
5069
|
this.content = part;
|
|
5067
5070
|
this._element.appendChild(this.content.element);
|
|
5068
5071
|
}
|
|
5072
|
+
updateDragAndDropState() {
|
|
5073
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5074
|
+
}
|
|
5069
5075
|
dispose() {
|
|
5070
5076
|
super.dispose();
|
|
5071
5077
|
}
|
|
@@ -5137,7 +5143,7 @@ class VoidContainer extends CompositeDisposable {
|
|
|
5137
5143
|
this.onDragStart = this._onDragStart.event;
|
|
5138
5144
|
this._element = document.createElement('div');
|
|
5139
5145
|
this._element.className = 'dv-void-container';
|
|
5140
|
-
this._element.draggable =
|
|
5146
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5141
5147
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5142
5148
|
this.accessor.doSetGroupActive(this.group);
|
|
5143
5149
|
}));
|
|
@@ -5160,6 +5166,9 @@ class VoidContainer extends CompositeDisposable {
|
|
|
5160
5166
|
this._onDrop.fire(event);
|
|
5161
5167
|
}), this.dropTarget);
|
|
5162
5168
|
}
|
|
5169
|
+
updateDragAndDropState() {
|
|
5170
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5171
|
+
}
|
|
5163
5172
|
}
|
|
5164
5173
|
|
|
5165
5174
|
class Scrollbar extends CompositeDisposable {
|
|
@@ -5420,6 +5429,11 @@ class Tabs extends CompositeDisposable {
|
|
|
5420
5429
|
.map((x) => x.value.panel.id);
|
|
5421
5430
|
this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
|
|
5422
5431
|
}
|
|
5432
|
+
updateDragAndDropState() {
|
|
5433
|
+
for (const tab of this._tabs) {
|
|
5434
|
+
tab.value.updateDragAndDropState();
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5423
5437
|
}
|
|
5424
5438
|
|
|
5425
5439
|
const createSvgElementFromPath = (params) => {
|
|
@@ -5692,6 +5706,10 @@ class TabsContainer extends CompositeDisposable {
|
|
|
5692
5706
|
});
|
|
5693
5707
|
}));
|
|
5694
5708
|
}
|
|
5709
|
+
updateDragAndDropState() {
|
|
5710
|
+
this.tabs.updateDragAndDropState();
|
|
5711
|
+
this.voidContainer.updateDragAndDropState();
|
|
5712
|
+
}
|
|
5695
5713
|
}
|
|
5696
5714
|
|
|
5697
5715
|
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
@@ -6397,6 +6415,9 @@ class DockviewGroupPanelModel extends CompositeDisposable {
|
|
|
6397
6415
|
}));
|
|
6398
6416
|
}
|
|
6399
6417
|
}
|
|
6418
|
+
updateDragAndDropState() {
|
|
6419
|
+
this.tabsContainer.updateDragAndDropState();
|
|
6420
|
+
}
|
|
6400
6421
|
dispose() {
|
|
6401
6422
|
var _a, _b, _c;
|
|
6402
6423
|
super.dispose();
|
|
@@ -8252,6 +8273,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
8252
8273
|
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8253
8274
|
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8254
8275
|
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8276
|
+
this._onDidOpenPopoutWindowFail = new Emitter();
|
|
8277
|
+
this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
|
|
8255
8278
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8256
8279
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8257
8280
|
this._onDidActivePanelChange = new Emitter({ replay: true });
|
|
@@ -8316,7 +8339,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8316
8339
|
if (options.debug) {
|
|
8317
8340
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8318
8341
|
}
|
|
8319
|
-
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(() => {
|
|
8342
|
+
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(() => {
|
|
8320
8343
|
this.updateWatermark();
|
|
8321
8344
|
}), this.onDidAdd((event) => {
|
|
8322
8345
|
if (!this._moving) {
|
|
@@ -8462,13 +8485,6 @@ class DockviewComponent extends BaseGrid {
|
|
|
8462
8485
|
if (_window.isDisposed) {
|
|
8463
8486
|
return false;
|
|
8464
8487
|
}
|
|
8465
|
-
if (popoutContainer === null) {
|
|
8466
|
-
popoutWindowDisposable.dispose();
|
|
8467
|
-
return false;
|
|
8468
|
-
}
|
|
8469
|
-
const gready = document.createElement('div');
|
|
8470
|
-
gready.className = 'dv-overlay-render-container';
|
|
8471
|
-
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8472
8488
|
const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
|
|
8473
8489
|
? options.referenceGroup
|
|
8474
8490
|
: itemToPopout instanceof DockviewPanel
|
|
@@ -8476,7 +8492,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8476
8492
|
: itemToPopout;
|
|
8477
8493
|
const referenceLocation = itemToPopout.api.location.type;
|
|
8478
8494
|
/**
|
|
8479
|
-
* The group that is being added doesn't already exist within the DOM, the most likely
|
|
8495
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurrence
|
|
8480
8496
|
* of this case is when being called from the `fromJSON(...)` method
|
|
8481
8497
|
*/
|
|
8482
8498
|
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
@@ -8489,8 +8505,28 @@ class DockviewComponent extends BaseGrid {
|
|
|
8489
8505
|
}
|
|
8490
8506
|
else {
|
|
8491
8507
|
group = this.createGroup({ id: groupId });
|
|
8492
|
-
|
|
8508
|
+
if (popoutContainer) {
|
|
8509
|
+
this._onDidAddGroup.fire(group);
|
|
8510
|
+
}
|
|
8511
|
+
}
|
|
8512
|
+
if (popoutContainer === null) {
|
|
8513
|
+
console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
|
|
8514
|
+
popoutWindowDisposable.dispose();
|
|
8515
|
+
this._onDidOpenPopoutWindowFail.fire();
|
|
8516
|
+
// if the popout window was blocked, we need to move the group back to the reference group
|
|
8517
|
+
// and set it to visible
|
|
8518
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
8519
|
+
from: group,
|
|
8520
|
+
to: referenceGroup,
|
|
8521
|
+
}));
|
|
8522
|
+
if (!referenceGroup.api.isVisible) {
|
|
8523
|
+
referenceGroup.api.setVisible(true);
|
|
8524
|
+
}
|
|
8525
|
+
return false;
|
|
8493
8526
|
}
|
|
8527
|
+
const gready = document.createElement('div');
|
|
8528
|
+
gready.className = 'dv-overlay-render-container';
|
|
8529
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8494
8530
|
group.model.renderContainer = overlayRenderContainer;
|
|
8495
8531
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8496
8532
|
let floatingBox;
|
|
@@ -8647,7 +8683,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8647
8683
|
return true;
|
|
8648
8684
|
})
|
|
8649
8685
|
.catch((err) => {
|
|
8650
|
-
console.error('dockview: failed to create popout
|
|
8686
|
+
console.error('dockview: failed to create popout.', err);
|
|
8651
8687
|
return false;
|
|
8652
8688
|
});
|
|
8653
8689
|
}
|
|
@@ -8854,7 +8890,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
8854
8890
|
}
|
|
8855
8891
|
}
|
|
8856
8892
|
this.updateDropTargetModel(options);
|
|
8893
|
+
const oldDisableDnd = this.options.disableDnd;
|
|
8857
8894
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
8895
|
+
const newDisableDnd = this.options.disableDnd;
|
|
8896
|
+
if (oldDisableDnd !== newDisableDnd) {
|
|
8897
|
+
this.updateDragAndDropState();
|
|
8898
|
+
}
|
|
8858
8899
|
if ('theme' in options) {
|
|
8859
8900
|
this.updateTheme();
|
|
8860
8901
|
}
|
|
@@ -8869,6 +8910,12 @@ class DockviewComponent extends BaseGrid {
|
|
|
8869
8910
|
}
|
|
8870
8911
|
}
|
|
8871
8912
|
}
|
|
8913
|
+
updateDragAndDropState() {
|
|
8914
|
+
// Update draggable state for all tabs and void containers
|
|
8915
|
+
for (const group of this.groups) {
|
|
8916
|
+
group.model.updateDragAndDropState();
|
|
8917
|
+
}
|
|
8918
|
+
}
|
|
8872
8919
|
focus() {
|
|
8873
8920
|
var _a;
|
|
8874
8921
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|