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
package/dist/dockview-react.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -5027,7 +5027,7 @@
|
|
|
5027
5027
|
this._element = document.createElement('div');
|
|
5028
5028
|
this._element.className = 'dv-tab';
|
|
5029
5029
|
this._element.tabIndex = 0;
|
|
5030
|
-
this._element.draggable =
|
|
5030
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5031
5031
|
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
5032
5032
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
5033
5033
|
this.dropTarget = new Droptarget(this._element, {
|
|
@@ -5075,6 +5075,9 @@
|
|
|
5075
5075
|
this.content = part;
|
|
5076
5076
|
this._element.appendChild(this.content.element);
|
|
5077
5077
|
}
|
|
5078
|
+
updateDragAndDropState() {
|
|
5079
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5080
|
+
}
|
|
5078
5081
|
dispose() {
|
|
5079
5082
|
super.dispose();
|
|
5080
5083
|
}
|
|
@@ -5146,7 +5149,7 @@
|
|
|
5146
5149
|
this.onDragStart = this._onDragStart.event;
|
|
5147
5150
|
this._element = document.createElement('div');
|
|
5148
5151
|
this._element.className = 'dv-void-container';
|
|
5149
|
-
this._element.draggable =
|
|
5152
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5150
5153
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5151
5154
|
this.accessor.doSetGroupActive(this.group);
|
|
5152
5155
|
}));
|
|
@@ -5169,6 +5172,9 @@
|
|
|
5169
5172
|
this._onDrop.fire(event);
|
|
5170
5173
|
}), this.dropTarget);
|
|
5171
5174
|
}
|
|
5175
|
+
updateDragAndDropState() {
|
|
5176
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5177
|
+
}
|
|
5172
5178
|
}
|
|
5173
5179
|
|
|
5174
5180
|
class Scrollbar extends CompositeDisposable {
|
|
@@ -5429,6 +5435,11 @@
|
|
|
5429
5435
|
.map((x) => x.value.panel.id);
|
|
5430
5436
|
this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
|
|
5431
5437
|
}
|
|
5438
|
+
updateDragAndDropState() {
|
|
5439
|
+
for (const tab of this._tabs) {
|
|
5440
|
+
tab.value.updateDragAndDropState();
|
|
5441
|
+
}
|
|
5442
|
+
}
|
|
5432
5443
|
}
|
|
5433
5444
|
|
|
5434
5445
|
const createSvgElementFromPath = (params) => {
|
|
@@ -5701,6 +5712,10 @@
|
|
|
5701
5712
|
});
|
|
5702
5713
|
}));
|
|
5703
5714
|
}
|
|
5715
|
+
updateDragAndDropState() {
|
|
5716
|
+
this.tabs.updateDragAndDropState();
|
|
5717
|
+
this.voidContainer.updateDragAndDropState();
|
|
5718
|
+
}
|
|
5704
5719
|
}
|
|
5705
5720
|
|
|
5706
5721
|
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
@@ -6406,6 +6421,9 @@
|
|
|
6406
6421
|
}));
|
|
6407
6422
|
}
|
|
6408
6423
|
}
|
|
6424
|
+
updateDragAndDropState() {
|
|
6425
|
+
this.tabsContainer.updateDragAndDropState();
|
|
6426
|
+
}
|
|
6409
6427
|
dispose() {
|
|
6410
6428
|
var _a, _b, _c;
|
|
6411
6429
|
super.dispose();
|
|
@@ -6651,23 +6669,24 @@
|
|
|
6651
6669
|
: window;
|
|
6652
6670
|
}
|
|
6653
6671
|
moveTo(options) {
|
|
6654
|
-
var _a, _b, _c;
|
|
6672
|
+
var _a, _b, _c, _d;
|
|
6655
6673
|
if (!this._group) {
|
|
6656
6674
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
6657
6675
|
}
|
|
6658
6676
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
6659
6677
|
direction: positionToDirection((_b = options.position) !== null && _b !== void 0 ? _b : 'right'),
|
|
6660
|
-
skipSetActive:
|
|
6678
|
+
skipSetActive: (_c = options.skipSetActive) !== null && _c !== void 0 ? _c : false,
|
|
6661
6679
|
});
|
|
6662
6680
|
this.accessor.moveGroupOrPanel({
|
|
6663
6681
|
from: { groupId: this._group.id },
|
|
6664
6682
|
to: {
|
|
6665
6683
|
group,
|
|
6666
6684
|
position: options.group
|
|
6667
|
-
? (
|
|
6685
|
+
? (_d = options.position) !== null && _d !== void 0 ? _d : 'center'
|
|
6668
6686
|
: 'center',
|
|
6669
6687
|
index: options.index,
|
|
6670
6688
|
},
|
|
6689
|
+
skipSetActive: options.skipSetActive,
|
|
6671
6690
|
});
|
|
6672
6691
|
}
|
|
6673
6692
|
maximize() {
|
|
@@ -6899,6 +6918,7 @@
|
|
|
6899
6918
|
: 'center',
|
|
6900
6919
|
index: options.index,
|
|
6901
6920
|
},
|
|
6921
|
+
skipSetActive: options.skipSetActive,
|
|
6902
6922
|
});
|
|
6903
6923
|
}
|
|
6904
6924
|
setTitle(title) {
|
|
@@ -8855,7 +8875,12 @@
|
|
|
8855
8875
|
}
|
|
8856
8876
|
}
|
|
8857
8877
|
this.updateDropTargetModel(options);
|
|
8878
|
+
const oldDisableDnd = this.options.disableDnd;
|
|
8858
8879
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
8880
|
+
const newDisableDnd = this.options.disableDnd;
|
|
8881
|
+
if (oldDisableDnd !== newDisableDnd) {
|
|
8882
|
+
this.updateDragAndDropState();
|
|
8883
|
+
}
|
|
8859
8884
|
if ('theme' in options) {
|
|
8860
8885
|
this.updateTheme();
|
|
8861
8886
|
}
|
|
@@ -8870,6 +8895,12 @@
|
|
|
8870
8895
|
}
|
|
8871
8896
|
}
|
|
8872
8897
|
}
|
|
8898
|
+
updateDragAndDropState() {
|
|
8899
|
+
// Update draggable state for all tabs and void containers
|
|
8900
|
+
for (const group of this.groups) {
|
|
8901
|
+
group.model.updateDragAndDropState();
|
|
8902
|
+
}
|
|
8903
|
+
}
|
|
8873
8904
|
focus() {
|
|
8874
8905
|
var _a;
|
|
8875
8906
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
@@ -9457,6 +9488,7 @@
|
|
|
9457
9488
|
group: destinationGroup,
|
|
9458
9489
|
position: destinationTarget,
|
|
9459
9490
|
},
|
|
9491
|
+
skipSetActive: options.skipSetActive,
|
|
9460
9492
|
});
|
|
9461
9493
|
return;
|
|
9462
9494
|
}
|
|
@@ -9475,11 +9507,17 @@
|
|
|
9475
9507
|
// remove the group and do not set a new group as active
|
|
9476
9508
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
9477
9509
|
}
|
|
9478
|
-
this.movingLock(() =>
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9510
|
+
this.movingLock(() => {
|
|
9511
|
+
var _a;
|
|
9512
|
+
return destinationGroup.model.openPanel(removedPanel, {
|
|
9513
|
+
index: destinationIndex,
|
|
9514
|
+
skipSetActive: (_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false,
|
|
9515
|
+
skipSetGroupActive: true,
|
|
9516
|
+
});
|
|
9517
|
+
});
|
|
9518
|
+
if (!options.skipSetActive) {
|
|
9519
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
9520
|
+
}
|
|
9483
9521
|
this._onDidMovePanel.fire({
|
|
9484
9522
|
panel: removedPanel,
|
|
9485
9523
|
from: sourceGroup,
|
|
@@ -9582,6 +9620,7 @@
|
|
|
9582
9620
|
const target = options.to.position;
|
|
9583
9621
|
if (target === 'center') {
|
|
9584
9622
|
const activePanel = from.activePanel;
|
|
9623
|
+
const targetActivePanel = to.activePanel;
|
|
9585
9624
|
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
9586
9625
|
skipSetActive: true,
|
|
9587
9626
|
})));
|
|
@@ -9591,12 +9630,23 @@
|
|
|
9591
9630
|
this.movingLock(() => {
|
|
9592
9631
|
for (const panel of panels) {
|
|
9593
9632
|
to.model.openPanel(panel, {
|
|
9594
|
-
skipSetActive:
|
|
9633
|
+
skipSetActive: true, // Always skip setting panels active during move
|
|
9595
9634
|
skipSetGroupActive: true,
|
|
9596
9635
|
});
|
|
9597
9636
|
}
|
|
9598
9637
|
});
|
|
9599
|
-
|
|
9638
|
+
if (!options.skipSetActive) {
|
|
9639
|
+
// Make the moved panel (from the source group) active
|
|
9640
|
+
if (activePanel) {
|
|
9641
|
+
this.doSetGroupAndPanelActive(to);
|
|
9642
|
+
}
|
|
9643
|
+
}
|
|
9644
|
+
else if (targetActivePanel) {
|
|
9645
|
+
// Ensure the target group's original active panel remains active
|
|
9646
|
+
to.model.openPanel(targetActivePanel, {
|
|
9647
|
+
skipSetGroupActive: true
|
|
9648
|
+
});
|
|
9649
|
+
}
|
|
9600
9650
|
}
|
|
9601
9651
|
else {
|
|
9602
9652
|
switch (from.api.location.type) {
|
|
@@ -9616,12 +9666,39 @@
|
|
|
9616
9666
|
if (!selectedPopoutGroup) {
|
|
9617
9667
|
throw new Error('failed to find popout group');
|
|
9618
9668
|
}
|
|
9619
|
-
|
|
9669
|
+
// Remove from popout groups list to prevent automatic restoration
|
|
9670
|
+
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
9671
|
+
if (index >= 0) {
|
|
9672
|
+
this._popoutGroups.splice(index, 1);
|
|
9673
|
+
}
|
|
9674
|
+
// Clean up the reference group (ghost) if it exists and is hidden
|
|
9675
|
+
if (selectedPopoutGroup.referenceGroup) {
|
|
9676
|
+
const referenceGroup = this.getPanel(selectedPopoutGroup.referenceGroup);
|
|
9677
|
+
if (referenceGroup && !referenceGroup.api.isVisible) {
|
|
9678
|
+
this.doRemoveGroup(referenceGroup, { skipActive: true });
|
|
9679
|
+
}
|
|
9680
|
+
}
|
|
9681
|
+
// Manually dispose the window without triggering restoration
|
|
9682
|
+
selectedPopoutGroup.window.dispose();
|
|
9683
|
+
// Update group's location and containers for target
|
|
9684
|
+
if (to.api.location.type === 'grid') {
|
|
9685
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
9686
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
9687
|
+
from.model.location = { type: 'grid' };
|
|
9688
|
+
}
|
|
9689
|
+
else if (to.api.location.type === 'floating') {
|
|
9690
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
9691
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
9692
|
+
from.model.location = { type: 'floating' };
|
|
9693
|
+
}
|
|
9694
|
+
break;
|
|
9620
9695
|
}
|
|
9621
9696
|
}
|
|
9622
|
-
|
|
9697
|
+
// For moves to grid locations
|
|
9698
|
+
if (to.api.location.type === 'grid') {
|
|
9623
9699
|
const referenceLocation = getGridLocation(to.element);
|
|
9624
9700
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
9701
|
+
// Add to grid for all moves targeting grid location
|
|
9625
9702
|
let size;
|
|
9626
9703
|
switch (this.gridview.orientation) {
|
|
9627
9704
|
case exports.Orientation.VERTICAL:
|
|
@@ -9639,10 +9716,49 @@
|
|
|
9639
9716
|
}
|
|
9640
9717
|
this.gridview.addView(from, size, dropLocation);
|
|
9641
9718
|
}
|
|
9719
|
+
else if (to.api.location.type === 'floating') {
|
|
9720
|
+
// For moves to floating locations, add as floating group
|
|
9721
|
+
// Get the position/size from the target floating group
|
|
9722
|
+
const targetFloatingGroup = this._floatingGroups.find((x) => x.group === to);
|
|
9723
|
+
if (targetFloatingGroup) {
|
|
9724
|
+
const box = targetFloatingGroup.overlay.toJSON();
|
|
9725
|
+
// Calculate position based on available properties
|
|
9726
|
+
let left, top;
|
|
9727
|
+
if ('left' in box) {
|
|
9728
|
+
left = box.left + 50;
|
|
9729
|
+
}
|
|
9730
|
+
else if ('right' in box) {
|
|
9731
|
+
left = Math.max(0, box.right - box.width - 50);
|
|
9732
|
+
}
|
|
9733
|
+
else {
|
|
9734
|
+
left = 50; // Default fallback
|
|
9735
|
+
}
|
|
9736
|
+
if ('top' in box) {
|
|
9737
|
+
top = box.top + 50;
|
|
9738
|
+
}
|
|
9739
|
+
else if ('bottom' in box) {
|
|
9740
|
+
top = Math.max(0, box.bottom - box.height - 50);
|
|
9741
|
+
}
|
|
9742
|
+
else {
|
|
9743
|
+
top = 50; // Default fallback
|
|
9744
|
+
}
|
|
9745
|
+
this.addFloatingGroup(from, {
|
|
9746
|
+
height: box.height,
|
|
9747
|
+
width: box.width,
|
|
9748
|
+
position: {
|
|
9749
|
+
left,
|
|
9750
|
+
top,
|
|
9751
|
+
},
|
|
9752
|
+
});
|
|
9753
|
+
}
|
|
9754
|
+
}
|
|
9642
9755
|
}
|
|
9643
9756
|
from.panels.forEach((panel) => {
|
|
9644
9757
|
this._onDidMovePanel.fire({ panel, from });
|
|
9645
9758
|
});
|
|
9759
|
+
if (!options.skipSetActive) {
|
|
9760
|
+
this.doSetGroupAndPanelActive(from);
|
|
9761
|
+
}
|
|
9646
9762
|
}
|
|
9647
9763
|
doSetGroupActive(group) {
|
|
9648
9764
|
super.doSetGroupActive(group);
|