dockview-react 4.4.0 → 4.5.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/dockview-react.amd.js +131 -15
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +131 -15
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +131 -15
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +131 -15
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +131 -15
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +131 -15
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.5.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -4997,7 +4997,7 @@
|
|
|
4997
4997
|
this._element = document.createElement('div');
|
|
4998
4998
|
this._element.className = 'dv-tab';
|
|
4999
4999
|
this._element.tabIndex = 0;
|
|
5000
|
-
this._element.draggable =
|
|
5000
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5001
5001
|
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
5002
5002
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
5003
5003
|
this.dropTarget = new Droptarget(this._element, {
|
|
@@ -5045,6 +5045,9 @@
|
|
|
5045
5045
|
this.content = part;
|
|
5046
5046
|
this._element.appendChild(this.content.element);
|
|
5047
5047
|
}
|
|
5048
|
+
updateDragAndDropState() {
|
|
5049
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5050
|
+
}
|
|
5048
5051
|
dispose() {
|
|
5049
5052
|
super.dispose();
|
|
5050
5053
|
}
|
|
@@ -5116,7 +5119,7 @@
|
|
|
5116
5119
|
this.onDragStart = this._onDragStart.event;
|
|
5117
5120
|
this._element = document.createElement('div');
|
|
5118
5121
|
this._element.className = 'dv-void-container';
|
|
5119
|
-
this._element.draggable =
|
|
5122
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5120
5123
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5121
5124
|
this.accessor.doSetGroupActive(this.group);
|
|
5122
5125
|
}));
|
|
@@ -5139,6 +5142,9 @@
|
|
|
5139
5142
|
this._onDrop.fire(event);
|
|
5140
5143
|
}), this.dropTarget);
|
|
5141
5144
|
}
|
|
5145
|
+
updateDragAndDropState() {
|
|
5146
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5147
|
+
}
|
|
5142
5148
|
}
|
|
5143
5149
|
|
|
5144
5150
|
class Scrollbar extends CompositeDisposable {
|
|
@@ -5399,6 +5405,11 @@
|
|
|
5399
5405
|
.map((x) => x.value.panel.id);
|
|
5400
5406
|
this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
|
|
5401
5407
|
}
|
|
5408
|
+
updateDragAndDropState() {
|
|
5409
|
+
for (const tab of this._tabs) {
|
|
5410
|
+
tab.value.updateDragAndDropState();
|
|
5411
|
+
}
|
|
5412
|
+
}
|
|
5402
5413
|
}
|
|
5403
5414
|
|
|
5404
5415
|
const createSvgElementFromPath = (params) => {
|
|
@@ -5671,6 +5682,10 @@
|
|
|
5671
5682
|
});
|
|
5672
5683
|
}));
|
|
5673
5684
|
}
|
|
5685
|
+
updateDragAndDropState() {
|
|
5686
|
+
this.tabs.updateDragAndDropState();
|
|
5687
|
+
this.voidContainer.updateDragAndDropState();
|
|
5688
|
+
}
|
|
5674
5689
|
}
|
|
5675
5690
|
|
|
5676
5691
|
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
@@ -6376,6 +6391,9 @@
|
|
|
6376
6391
|
}));
|
|
6377
6392
|
}
|
|
6378
6393
|
}
|
|
6394
|
+
updateDragAndDropState() {
|
|
6395
|
+
this.tabsContainer.updateDragAndDropState();
|
|
6396
|
+
}
|
|
6379
6397
|
dispose() {
|
|
6380
6398
|
var _a, _b, _c;
|
|
6381
6399
|
super.dispose();
|
|
@@ -6621,23 +6639,24 @@
|
|
|
6621
6639
|
: window;
|
|
6622
6640
|
}
|
|
6623
6641
|
moveTo(options) {
|
|
6624
|
-
var _a, _b, _c;
|
|
6642
|
+
var _a, _b, _c, _d;
|
|
6625
6643
|
if (!this._group) {
|
|
6626
6644
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
6627
6645
|
}
|
|
6628
6646
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
6629
6647
|
direction: positionToDirection((_b = options.position) !== null && _b !== void 0 ? _b : 'right'),
|
|
6630
|
-
skipSetActive:
|
|
6648
|
+
skipSetActive: (_c = options.skipSetActive) !== null && _c !== void 0 ? _c : false,
|
|
6631
6649
|
});
|
|
6632
6650
|
this.accessor.moveGroupOrPanel({
|
|
6633
6651
|
from: { groupId: this._group.id },
|
|
6634
6652
|
to: {
|
|
6635
6653
|
group,
|
|
6636
6654
|
position: options.group
|
|
6637
|
-
? (
|
|
6655
|
+
? (_d = options.position) !== null && _d !== void 0 ? _d : 'center'
|
|
6638
6656
|
: 'center',
|
|
6639
6657
|
index: options.index,
|
|
6640
6658
|
},
|
|
6659
|
+
skipSetActive: options.skipSetActive,
|
|
6641
6660
|
});
|
|
6642
6661
|
}
|
|
6643
6662
|
maximize() {
|
|
@@ -6869,6 +6888,7 @@
|
|
|
6869
6888
|
: 'center',
|
|
6870
6889
|
index: options.index,
|
|
6871
6890
|
},
|
|
6891
|
+
skipSetActive: options.skipSetActive,
|
|
6872
6892
|
});
|
|
6873
6893
|
}
|
|
6874
6894
|
setTitle(title) {
|
|
@@ -8825,7 +8845,12 @@
|
|
|
8825
8845
|
}
|
|
8826
8846
|
}
|
|
8827
8847
|
this.updateDropTargetModel(options);
|
|
8848
|
+
const oldDisableDnd = this.options.disableDnd;
|
|
8828
8849
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
8850
|
+
const newDisableDnd = this.options.disableDnd;
|
|
8851
|
+
if (oldDisableDnd !== newDisableDnd) {
|
|
8852
|
+
this.updateDragAndDropState();
|
|
8853
|
+
}
|
|
8829
8854
|
if ('theme' in options) {
|
|
8830
8855
|
this.updateTheme();
|
|
8831
8856
|
}
|
|
@@ -8840,6 +8865,12 @@
|
|
|
8840
8865
|
}
|
|
8841
8866
|
}
|
|
8842
8867
|
}
|
|
8868
|
+
updateDragAndDropState() {
|
|
8869
|
+
// Update draggable state for all tabs and void containers
|
|
8870
|
+
for (const group of this.groups) {
|
|
8871
|
+
group.model.updateDragAndDropState();
|
|
8872
|
+
}
|
|
8873
|
+
}
|
|
8843
8874
|
focus() {
|
|
8844
8875
|
var _a;
|
|
8845
8876
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -9427,6 +9458,7 @@
|
|
|
9427
9458
|
group: destinationGroup,
|
|
9428
9459
|
position: destinationTarget,
|
|
9429
9460
|
},
|
|
9461
|
+
skipSetActive: options.skipSetActive,
|
|
9430
9462
|
});
|
|
9431
9463
|
return;
|
|
9432
9464
|
}
|
|
@@ -9445,11 +9477,17 @@
|
|
|
9445
9477
|
// remove the group and do not set a new group as active
|
|
9446
9478
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9447
9479
|
}
|
|
9448
|
-
this.movingLock(() =>
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9480
|
+
this.movingLock(() => {
|
|
9481
|
+
var _a;
|
|
9482
|
+
return destinationGroup.model.openPanel(removedPanel, {
|
|
9483
|
+
index: destinationIndex,
|
|
9484
|
+
skipSetActive: (_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false,
|
|
9485
|
+
skipSetGroupActive: true,
|
|
9486
|
+
});
|
|
9487
|
+
});
|
|
9488
|
+
if (!options.skipSetActive) {
|
|
9489
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
9490
|
+
}
|
|
9453
9491
|
this._onDidMovePanel.fire({
|
|
9454
9492
|
panel: removedPanel,
|
|
9455
9493
|
from: sourceGroup,
|
|
@@ -9552,6 +9590,7 @@
|
|
|
9552
9590
|
const target = options.to.position;
|
|
9553
9591
|
if (target === 'center') {
|
|
9554
9592
|
const activePanel = from.activePanel;
|
|
9593
|
+
const targetActivePanel = to.activePanel;
|
|
9555
9594
|
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
9556
9595
|
skipSetActive: true,
|
|
9557
9596
|
})));
|
|
@@ -9561,12 +9600,23 @@
|
|
|
9561
9600
|
this.movingLock(() => {
|
|
9562
9601
|
for (const panel of panels) {
|
|
9563
9602
|
to.model.openPanel(panel, {
|
|
9564
|
-
skipSetActive:
|
|
9603
|
+
skipSetActive: true, // Always skip setting panels active during move
|
|
9565
9604
|
skipSetGroupActive: true,
|
|
9566
9605
|
});
|
|
9567
9606
|
}
|
|
9568
9607
|
});
|
|
9569
|
-
|
|
9608
|
+
if (!options.skipSetActive) {
|
|
9609
|
+
// Make the moved panel (from the source group) active
|
|
9610
|
+
if (activePanel) {
|
|
9611
|
+
this.doSetGroupAndPanelActive(to);
|
|
9612
|
+
}
|
|
9613
|
+
}
|
|
9614
|
+
else if (targetActivePanel) {
|
|
9615
|
+
// Ensure the target group's original active panel remains active
|
|
9616
|
+
to.model.openPanel(targetActivePanel, {
|
|
9617
|
+
skipSetGroupActive: true
|
|
9618
|
+
});
|
|
9619
|
+
}
|
|
9570
9620
|
}
|
|
9571
9621
|
else {
|
|
9572
9622
|
switch (from.api.location.type) {
|
|
@@ -9586,12 +9636,39 @@
|
|
|
9586
9636
|
if (!selectedPopoutGroup) {
|
|
9587
9637
|
throw new Error('failed to find popout group');
|
|
9588
9638
|
}
|
|
9589
|
-
|
|
9639
|
+
// Remove from popout groups list to prevent automatic restoration
|
|
9640
|
+
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
9641
|
+
if (index >= 0) {
|
|
9642
|
+
this._popoutGroups.splice(index, 1);
|
|
9643
|
+
}
|
|
9644
|
+
// Clean up the reference group (ghost) if it exists and is hidden
|
|
9645
|
+
if (selectedPopoutGroup.referenceGroup) {
|
|
9646
|
+
const referenceGroup = this.getPanel(selectedPopoutGroup.referenceGroup);
|
|
9647
|
+
if (referenceGroup && !referenceGroup.api.isVisible) {
|
|
9648
|
+
this.doRemoveGroup(referenceGroup, { skipActive: true });
|
|
9649
|
+
}
|
|
9650
|
+
}
|
|
9651
|
+
// Manually dispose the window without triggering restoration
|
|
9652
|
+
selectedPopoutGroup.window.dispose();
|
|
9653
|
+
// Update group's location and containers for target
|
|
9654
|
+
if (to.api.location.type === 'grid') {
|
|
9655
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
9656
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
9657
|
+
from.model.location = { type: 'grid' };
|
|
9658
|
+
}
|
|
9659
|
+
else if (to.api.location.type === 'floating') {
|
|
9660
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
9661
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
9662
|
+
from.model.location = { type: 'floating' };
|
|
9663
|
+
}
|
|
9664
|
+
break;
|
|
9590
9665
|
}
|
|
9591
9666
|
}
|
|
9592
|
-
|
|
9667
|
+
// For moves to grid locations
|
|
9668
|
+
if (to.api.location.type === 'grid') {
|
|
9593
9669
|
const referenceLocation = getGridLocation(to.element);
|
|
9594
9670
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9671
|
+
// Add to grid for all moves targeting grid location
|
|
9595
9672
|
let size;
|
|
9596
9673
|
switch (this.gridview.orientation) {
|
|
9597
9674
|
case exports.Orientation.VERTICAL:
|
|
@@ -9609,10 +9686,49 @@
|
|
|
9609
9686
|
}
|
|
9610
9687
|
this.gridview.addView(from, size, dropLocation);
|
|
9611
9688
|
}
|
|
9689
|
+
else if (to.api.location.type === 'floating') {
|
|
9690
|
+
// For moves to floating locations, add as floating group
|
|
9691
|
+
// Get the position/size from the target floating group
|
|
9692
|
+
const targetFloatingGroup = this._floatingGroups.find((x) => x.group === to);
|
|
9693
|
+
if (targetFloatingGroup) {
|
|
9694
|
+
const box = targetFloatingGroup.overlay.toJSON();
|
|
9695
|
+
// Calculate position based on available properties
|
|
9696
|
+
let left, top;
|
|
9697
|
+
if ('left' in box) {
|
|
9698
|
+
left = box.left + 50;
|
|
9699
|
+
}
|
|
9700
|
+
else if ('right' in box) {
|
|
9701
|
+
left = Math.max(0, box.right - box.width - 50);
|
|
9702
|
+
}
|
|
9703
|
+
else {
|
|
9704
|
+
left = 50; // Default fallback
|
|
9705
|
+
}
|
|
9706
|
+
if ('top' in box) {
|
|
9707
|
+
top = box.top + 50;
|
|
9708
|
+
}
|
|
9709
|
+
else if ('bottom' in box) {
|
|
9710
|
+
top = Math.max(0, box.bottom - box.height - 50);
|
|
9711
|
+
}
|
|
9712
|
+
else {
|
|
9713
|
+
top = 50; // Default fallback
|
|
9714
|
+
}
|
|
9715
|
+
this.addFloatingGroup(from, {
|
|
9716
|
+
height: box.height,
|
|
9717
|
+
width: box.width,
|
|
9718
|
+
position: {
|
|
9719
|
+
left,
|
|
9720
|
+
top,
|
|
9721
|
+
},
|
|
9722
|
+
});
|
|
9723
|
+
}
|
|
9724
|
+
}
|
|
9612
9725
|
}
|
|
9613
9726
|
from.panels.forEach((panel) => {
|
|
9614
9727
|
this._onDidMovePanel.fire({ panel, from });
|
|
9615
9728
|
});
|
|
9729
|
+
if (!options.skipSetActive) {
|
|
9730
|
+
this.doSetGroupAndPanelActive(from);
|
|
9731
|
+
}
|
|
9616
9732
|
}
|
|
9617
9733
|
doSetGroupActive(group) {
|
|
9618
9734
|
super.doSetGroupActive(group);
|