dockview-core 4.4.1 → 4.6.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/component.api.d.ts +2 -1
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +4 -0
- package/dist/cjs/api/dockviewGroupPanelApi.js +4 -3
- package/dist/cjs/api/dockviewPanelApi.js +1 -0
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +1 -1
- package/dist/cjs/dockview/components/titlebar/tabs.js +2 -2
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +1 -1
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +6 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +3 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -1
- package/dist/cjs/dockview/dockviewComponent.js +91 -7
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +3 -24
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +3 -65
- package/dist/cjs/dockview/events.d.ts +28 -0
- package/dist/cjs/dockview/events.js +66 -0
- package/dist/cjs/dockview/options.d.ts +2 -1
- package/dist/dockview-core.amd.js +141 -49
- 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 +140 -48
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +141 -49
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +142 -49
- 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 +141 -49
- 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 +140 -48
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +2 -1
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +4 -0
- package/dist/esm/api/dockviewGroupPanelApi.js +4 -3
- package/dist/esm/api/dockviewPanelApi.js +1 -0
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +1 -1
- package/dist/esm/dockview/components/titlebar/tabs.js +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +1 -1
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +5 -2
- package/dist/esm/dockview/components/titlebar/voidContainer.js +3 -0
- package/dist/esm/dockview/dockviewComponent.d.ts +4 -1
- package/dist/esm/dockview/dockviewComponent.js +96 -10
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +3 -24
- package/dist/esm/dockview/dockviewGroupPanelModel.js +1 -33
- package/dist/esm/dockview/events.d.ts +28 -0
- package/dist/esm/dockview/events.js +33 -0
- package/dist/esm/dockview/options.d.ts +2 -1
- package/dist/styles/dockview.css +5 -0
- package/package.json +4 -5
|
@@ -15,7 +15,8 @@ import { IDockviewPanel } from '../dockview/dockviewPanel';
|
|
|
15
15
|
import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
|
|
16
16
|
import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/tabsContainer';
|
|
17
17
|
import { Box } from '../types';
|
|
18
|
-
import { DockviewDidDropEvent, DockviewWillDropEvent
|
|
18
|
+
import { DockviewDidDropEvent, DockviewWillDropEvent } from '../dockview/dockviewGroupPanelModel';
|
|
19
|
+
import { WillShowOverlayLocationEvent } from '../dockview/events';
|
|
19
20
|
import { PaneviewComponentOptions, PaneviewDndOverlayEvent } from '../paneview/options';
|
|
20
21
|
import { SplitviewComponentOptions } from '../splitview/options';
|
|
21
22
|
import { GridviewComponentOptions } from '../gridview/options';
|
|
@@ -11,6 +11,10 @@ export interface DockviewGroupMoveParams {
|
|
|
11
11
|
* The index to place the panel within a group, only applicable if the placement is within an existing group
|
|
12
12
|
*/
|
|
13
13
|
index?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to skip setting the group as active after moving
|
|
16
|
+
*/
|
|
17
|
+
skipSetActive?: boolean;
|
|
14
18
|
}
|
|
15
19
|
export interface DockviewGroupPanelApi extends GridviewPanelApi {
|
|
16
20
|
readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
|
|
@@ -30,23 +30,24 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
30
30
|
: window;
|
|
31
31
|
}
|
|
32
32
|
moveTo(options) {
|
|
33
|
-
var _a, _b, _c;
|
|
33
|
+
var _a, _b, _c, _d;
|
|
34
34
|
if (!this._group) {
|
|
35
35
|
throw new Error(NOT_INITIALIZED_MESSAGE);
|
|
36
36
|
}
|
|
37
37
|
const group = (_a = options.group) !== null && _a !== void 0 ? _a : this.accessor.addGroup({
|
|
38
38
|
direction: positionToDirection((_b = options.position) !== null && _b !== void 0 ? _b : 'right'),
|
|
39
|
-
skipSetActive:
|
|
39
|
+
skipSetActive: (_c = options.skipSetActive) !== null && _c !== void 0 ? _c : false,
|
|
40
40
|
});
|
|
41
41
|
this.accessor.moveGroupOrPanel({
|
|
42
42
|
from: { groupId: this._group.id },
|
|
43
43
|
to: {
|
|
44
44
|
group,
|
|
45
45
|
position: options.group
|
|
46
|
-
? (
|
|
46
|
+
? (_d = options.position) !== null && _d !== void 0 ? _d : 'center'
|
|
47
47
|
: 'center',
|
|
48
48
|
index: options.index,
|
|
49
49
|
},
|
|
50
|
+
skipSetActive: options.skipSetActive,
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
maximize() {
|
|
@@ -2,7 +2,7 @@ import { Event } from '../../../events';
|
|
|
2
2
|
import { CompositeDisposable } from '../../../lifecycle';
|
|
3
3
|
import { DockviewComponent } from '../../dockviewComponent';
|
|
4
4
|
import { DockviewGroupPanel } from '../../dockviewGroupPanel';
|
|
5
|
-
import { WillShowOverlayLocationEvent } from '../../
|
|
5
|
+
import { WillShowOverlayLocationEvent } from '../../events';
|
|
6
6
|
import { IDockviewPanel } from '../../dockviewPanel';
|
|
7
7
|
import { Tab } from '../tab/tab';
|
|
8
8
|
import { TabDragEvent, TabDropIndexEvent } from './tabsContainer';
|
|
@@ -3,7 +3,7 @@ import { isChildEntirelyVisibleWithinParent, OverflowObserver, } from '../../../
|
|
|
3
3
|
import { addDisposableListener, Emitter } from '../../../events';
|
|
4
4
|
import { CompositeDisposable, Disposable, MutableDisposable, } from '../../../lifecycle';
|
|
5
5
|
import { Scrollbar } from '../../../scrollbar';
|
|
6
|
-
import { WillShowOverlayLocationEvent } from '../../
|
|
6
|
+
import { WillShowOverlayLocationEvent } from '../../events';
|
|
7
7
|
import { Tab } from '../tab/tab';
|
|
8
8
|
export class Tabs extends CompositeDisposable {
|
|
9
9
|
get showTabsOverflowControl() {
|
|
@@ -4,7 +4,7 @@ import { Tab } from '../tab/tab';
|
|
|
4
4
|
import { DockviewGroupPanel } from '../../dockviewGroupPanel';
|
|
5
5
|
import { IDockviewPanel } from '../../dockviewPanel';
|
|
6
6
|
import { DockviewComponent } from '../../dockviewComponent';
|
|
7
|
-
import { WillShowOverlayLocationEvent } from '../../
|
|
7
|
+
import { WillShowOverlayLocationEvent } from '../../events';
|
|
8
8
|
export interface TabDropIndexEvent {
|
|
9
9
|
readonly event: DragEvent;
|
|
10
10
|
readonly index: number;
|
|
@@ -2,7 +2,7 @@ import { CompositeDisposable, Disposable, MutableDisposable, } from '../../../li
|
|
|
2
2
|
import { addDisposableListener, Emitter } from '../../../events';
|
|
3
3
|
import { VoidContainer } from './voidContainer';
|
|
4
4
|
import { findRelativeZIndexParent, toggleClass } from '../../../dom';
|
|
5
|
-
import { WillShowOverlayLocationEvent } from '../../
|
|
5
|
+
import { WillShowOverlayLocationEvent } from '../../events';
|
|
6
6
|
import { getPanelData } from '../../../dnd/dataTransfer';
|
|
7
7
|
import { Tabs } from './tabs';
|
|
8
8
|
import { createDropdownElementHandle, } from './tabOverflowControl';
|
|
@@ -210,8 +210,11 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
210
210
|
toggleClass(wrapper, 'dv-tab', true);
|
|
211
211
|
toggleClass(wrapper, 'dv-active-tab', panelObject.api.isActive);
|
|
212
212
|
toggleClass(wrapper, 'dv-inactive-tab', !panelObject.api.isActive);
|
|
213
|
-
wrapper.addEventListener('
|
|
213
|
+
wrapper.addEventListener('click', (event) => {
|
|
214
214
|
this.accessor.popupService.close();
|
|
215
|
+
if (event.defaultPrevented) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
215
218
|
tab.element.scrollIntoView();
|
|
216
219
|
tab.panel.api.setActive();
|
|
217
220
|
});
|
|
@@ -3,6 +3,7 @@ import { Droptarget, } from '../../../dnd/droptarget';
|
|
|
3
3
|
import { GroupDragHandler } from '../../../dnd/groupDragHandler';
|
|
4
4
|
import { addDisposableListener, Emitter } from '../../../events';
|
|
5
5
|
import { CompositeDisposable } from '../../../lifecycle';
|
|
6
|
+
import { toggleClass } from '../../../dom';
|
|
6
7
|
export class VoidContainer extends CompositeDisposable {
|
|
7
8
|
get element() {
|
|
8
9
|
return this._element;
|
|
@@ -18,6 +19,7 @@ export class VoidContainer extends CompositeDisposable {
|
|
|
18
19
|
this._element = document.createElement('div');
|
|
19
20
|
this._element.className = 'dv-void-container';
|
|
20
21
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
22
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
21
23
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
22
24
|
this.accessor.doSetGroupActive(this.group);
|
|
23
25
|
}));
|
|
@@ -42,5 +44,6 @@ export class VoidContainer extends CompositeDisposable {
|
|
|
42
44
|
}
|
|
43
45
|
updateDragAndDropState() {
|
|
44
46
|
this._element.draggable = !this.accessor.options.disableDnd;
|
|
47
|
+
toggleClass(this._element, 'dv-draggable', !this.accessor.options.disableDnd);
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -7,7 +7,8 @@ import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, DockviewDnd
|
|
|
7
7
|
import { BaseGrid, IBaseGrid } from '../gridview/baseComponentGridview';
|
|
8
8
|
import { DockviewApi } from '../api/component.api';
|
|
9
9
|
import { Orientation } from '../splitview/splitview';
|
|
10
|
-
import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDropEvent
|
|
10
|
+
import { GroupOptions, GroupPanelViewState, DockviewDidDropEvent, DockviewWillDropEvent } from './dockviewGroupPanelModel';
|
|
11
|
+
import { WillShowOverlayLocationEvent } from './events';
|
|
11
12
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
12
13
|
import { Parameters } from '../panel/types';
|
|
13
14
|
import { DockviewFloatingGroupPanel } from './dockviewFloatingGroupPanel';
|
|
@@ -80,6 +81,7 @@ type MoveGroupOptions = {
|
|
|
80
81
|
group: DockviewGroupPanel;
|
|
81
82
|
position: Position;
|
|
82
83
|
};
|
|
84
|
+
skipSetActive?: boolean;
|
|
83
85
|
};
|
|
84
86
|
type MoveGroupOrPanelOptions = {
|
|
85
87
|
from: {
|
|
@@ -91,6 +93,7 @@ type MoveGroupOrPanelOptions = {
|
|
|
91
93
|
position: Position;
|
|
92
94
|
index?: number;
|
|
93
95
|
};
|
|
96
|
+
skipSetActive?: boolean;
|
|
94
97
|
};
|
|
95
98
|
export interface FloatingGroupOptions {
|
|
96
99
|
x?: number;
|
|
@@ -11,7 +11,8 @@ import { DockviewUnhandledDragOverEvent, isGroupOptionsWithGroup, isGroupOptions
|
|
|
11
11
|
import { BaseGrid, toTarget, } from '../gridview/baseComponentGridview';
|
|
12
12
|
import { DockviewApi } from '../api/component.api';
|
|
13
13
|
import { Orientation } from '../splitview/splitview';
|
|
14
|
-
import { DockviewDidDropEvent, DockviewWillDropEvent,
|
|
14
|
+
import { DockviewDidDropEvent, DockviewWillDropEvent, } from './dockviewGroupPanelModel';
|
|
15
|
+
import { WillShowOverlayLocationEvent } from './events';
|
|
15
16
|
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
16
17
|
import { DockviewPanelModel } from './dockviewPanelModel';
|
|
17
18
|
import { getPanelData } from '../dnd/dataTransfer';
|
|
@@ -1341,6 +1342,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1341
1342
|
group: destinationGroup,
|
|
1342
1343
|
position: destinationTarget,
|
|
1343
1344
|
},
|
|
1345
|
+
skipSetActive: options.skipSetActive,
|
|
1344
1346
|
});
|
|
1345
1347
|
return;
|
|
1346
1348
|
}
|
|
@@ -1359,11 +1361,17 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1359
1361
|
// remove the group and do not set a new group as active
|
|
1360
1362
|
this.doRemoveGroup(sourceGroup, { skipActive: true });
|
|
1361
1363
|
}
|
|
1362
|
-
this.movingLock(() =>
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1364
|
+
this.movingLock(() => {
|
|
1365
|
+
var _a;
|
|
1366
|
+
return destinationGroup.model.openPanel(removedPanel, {
|
|
1367
|
+
index: destinationIndex,
|
|
1368
|
+
skipSetActive: (_a = options.skipSetActive) !== null && _a !== void 0 ? _a : false,
|
|
1369
|
+
skipSetGroupActive: true,
|
|
1370
|
+
});
|
|
1371
|
+
});
|
|
1372
|
+
if (!options.skipSetActive) {
|
|
1373
|
+
this.doSetGroupAndPanelActive(destinationGroup);
|
|
1374
|
+
}
|
|
1367
1375
|
this._onDidMovePanel.fire({
|
|
1368
1376
|
panel: removedPanel,
|
|
1369
1377
|
from: sourceGroup,
|
|
@@ -1466,6 +1474,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1466
1474
|
const target = options.to.position;
|
|
1467
1475
|
if (target === 'center') {
|
|
1468
1476
|
const activePanel = from.activePanel;
|
|
1477
|
+
const targetActivePanel = to.activePanel;
|
|
1469
1478
|
const panels = this.movingLock(() => [...from.panels].map((p) => from.model.removePanel(p.id, {
|
|
1470
1479
|
skipSetActive: true,
|
|
1471
1480
|
})));
|
|
@@ -1475,12 +1484,23 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1475
1484
|
this.movingLock(() => {
|
|
1476
1485
|
for (const panel of panels) {
|
|
1477
1486
|
to.model.openPanel(panel, {
|
|
1478
|
-
skipSetActive:
|
|
1487
|
+
skipSetActive: true, // Always skip setting panels active during move
|
|
1479
1488
|
skipSetGroupActive: true,
|
|
1480
1489
|
});
|
|
1481
1490
|
}
|
|
1482
1491
|
});
|
|
1483
|
-
|
|
1492
|
+
if (!options.skipSetActive) {
|
|
1493
|
+
// Make the moved panel (from the source group) active
|
|
1494
|
+
if (activePanel) {
|
|
1495
|
+
this.doSetGroupAndPanelActive(to);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
else if (targetActivePanel) {
|
|
1499
|
+
// Ensure the target group's original active panel remains active
|
|
1500
|
+
to.model.openPanel(targetActivePanel, {
|
|
1501
|
+
skipSetGroupActive: true
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1484
1504
|
}
|
|
1485
1505
|
else {
|
|
1486
1506
|
switch (from.api.location.type) {
|
|
@@ -1500,12 +1520,39 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1500
1520
|
if (!selectedPopoutGroup) {
|
|
1501
1521
|
throw new Error('failed to find popout group');
|
|
1502
1522
|
}
|
|
1503
|
-
|
|
1523
|
+
// Remove from popout groups list to prevent automatic restoration
|
|
1524
|
+
const index = this._popoutGroups.indexOf(selectedPopoutGroup);
|
|
1525
|
+
if (index >= 0) {
|
|
1526
|
+
this._popoutGroups.splice(index, 1);
|
|
1527
|
+
}
|
|
1528
|
+
// Clean up the reference group (ghost) if it exists and is hidden
|
|
1529
|
+
if (selectedPopoutGroup.referenceGroup) {
|
|
1530
|
+
const referenceGroup = this.getPanel(selectedPopoutGroup.referenceGroup);
|
|
1531
|
+
if (referenceGroup && !referenceGroup.api.isVisible) {
|
|
1532
|
+
this.doRemoveGroup(referenceGroup, { skipActive: true });
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
// Manually dispose the window without triggering restoration
|
|
1536
|
+
selectedPopoutGroup.window.dispose();
|
|
1537
|
+
// Update group's location and containers for target
|
|
1538
|
+
if (to.api.location.type === 'grid') {
|
|
1539
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
1540
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
1541
|
+
from.model.location = { type: 'grid' };
|
|
1542
|
+
}
|
|
1543
|
+
else if (to.api.location.type === 'floating') {
|
|
1544
|
+
from.model.renderContainer = this.overlayRenderContainer;
|
|
1545
|
+
from.model.dropTargetContainer = this.rootDropTargetContainer;
|
|
1546
|
+
from.model.location = { type: 'floating' };
|
|
1547
|
+
}
|
|
1548
|
+
break;
|
|
1504
1549
|
}
|
|
1505
1550
|
}
|
|
1506
|
-
|
|
1551
|
+
// For moves to grid locations
|
|
1552
|
+
if (to.api.location.type === 'grid') {
|
|
1507
1553
|
const referenceLocation = getGridLocation(to.element);
|
|
1508
1554
|
const dropLocation = getRelativeLocation(this.gridview.orientation, referenceLocation, target);
|
|
1555
|
+
// Add to grid for all moves targeting grid location
|
|
1509
1556
|
let size;
|
|
1510
1557
|
switch (this.gridview.orientation) {
|
|
1511
1558
|
case Orientation.VERTICAL:
|
|
@@ -1523,10 +1570,49 @@ export class DockviewComponent extends BaseGrid {
|
|
|
1523
1570
|
}
|
|
1524
1571
|
this.gridview.addView(from, size, dropLocation);
|
|
1525
1572
|
}
|
|
1573
|
+
else if (to.api.location.type === 'floating') {
|
|
1574
|
+
// For moves to floating locations, add as floating group
|
|
1575
|
+
// Get the position/size from the target floating group
|
|
1576
|
+
const targetFloatingGroup = this._floatingGroups.find((x) => x.group === to);
|
|
1577
|
+
if (targetFloatingGroup) {
|
|
1578
|
+
const box = targetFloatingGroup.overlay.toJSON();
|
|
1579
|
+
// Calculate position based on available properties
|
|
1580
|
+
let left, top;
|
|
1581
|
+
if ('left' in box) {
|
|
1582
|
+
left = box.left + 50;
|
|
1583
|
+
}
|
|
1584
|
+
else if ('right' in box) {
|
|
1585
|
+
left = Math.max(0, box.right - box.width - 50);
|
|
1586
|
+
}
|
|
1587
|
+
else {
|
|
1588
|
+
left = 50; // Default fallback
|
|
1589
|
+
}
|
|
1590
|
+
if ('top' in box) {
|
|
1591
|
+
top = box.top + 50;
|
|
1592
|
+
}
|
|
1593
|
+
else if ('bottom' in box) {
|
|
1594
|
+
top = Math.max(0, box.bottom - box.height - 50);
|
|
1595
|
+
}
|
|
1596
|
+
else {
|
|
1597
|
+
top = 50; // Default fallback
|
|
1598
|
+
}
|
|
1599
|
+
this.addFloatingGroup(from, {
|
|
1600
|
+
height: box.height,
|
|
1601
|
+
width: box.width,
|
|
1602
|
+
position: {
|
|
1603
|
+
left,
|
|
1604
|
+
top,
|
|
1605
|
+
},
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1526
1609
|
}
|
|
1527
1610
|
from.panels.forEach((panel) => {
|
|
1528
1611
|
this._onDidMovePanel.fire({ panel, from });
|
|
1529
1612
|
});
|
|
1613
|
+
if (!options.skipSetActive) {
|
|
1614
|
+
this.doSetGroupAndPanelActive(from);
|
|
1615
|
+
}
|
|
1530
1616
|
}
|
|
1531
1617
|
doSetGroupActive(group) {
|
|
1532
1618
|
super.doSetGroupActive(group);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DockviewApi } from '../api/component.api';
|
|
2
2
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
3
|
-
import { Position
|
|
3
|
+
import { Position } from '../dnd/droptarget';
|
|
4
4
|
import { DockviewComponent } from './dockviewComponent';
|
|
5
|
-
import { DockviewEvent, Event
|
|
5
|
+
import { DockviewEvent, Event } from '../events';
|
|
6
|
+
import { DockviewGroupDropLocation, WillShowOverlayLocationEvent } from './events';
|
|
6
7
|
import { IViewSize } from '../gridview/gridview';
|
|
7
8
|
import { CompositeDisposable } from '../lifecycle';
|
|
8
9
|
import { IPanel, PanelInitParameters, PanelUpdateEvent, Parameters } from '../panel/types';
|
|
@@ -75,7 +76,6 @@ export interface IHeader {
|
|
|
75
76
|
hidden: boolean;
|
|
76
77
|
}
|
|
77
78
|
export type DockviewGroupPanelLocked = boolean | 'no-drop-target';
|
|
78
|
-
export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content' | 'edge';
|
|
79
79
|
export interface IDockviewGroupPanelModel extends IPanel {
|
|
80
80
|
readonly isActive: boolean;
|
|
81
81
|
readonly size: number;
|
|
@@ -123,27 +123,6 @@ export type DockviewGroupLocation = {
|
|
|
123
123
|
getWindow: () => Window;
|
|
124
124
|
popoutUrl?: string;
|
|
125
125
|
};
|
|
126
|
-
export interface WillShowOverlayLocationEventOptions {
|
|
127
|
-
readonly kind: DockviewGroupDropLocation;
|
|
128
|
-
readonly panel: IDockviewPanel | undefined;
|
|
129
|
-
readonly api: DockviewApi;
|
|
130
|
-
readonly group: DockviewGroupPanel | undefined;
|
|
131
|
-
getData: () => PanelTransfer | undefined;
|
|
132
|
-
}
|
|
133
|
-
export declare class WillShowOverlayLocationEvent implements IDockviewEvent {
|
|
134
|
-
private readonly event;
|
|
135
|
-
readonly options: WillShowOverlayLocationEventOptions;
|
|
136
|
-
get kind(): DockviewGroupDropLocation;
|
|
137
|
-
get nativeEvent(): DragEvent;
|
|
138
|
-
get position(): Position;
|
|
139
|
-
get defaultPrevented(): boolean;
|
|
140
|
-
get panel(): IDockviewPanel | undefined;
|
|
141
|
-
get api(): DockviewApi;
|
|
142
|
-
get group(): DockviewGroupPanel | undefined;
|
|
143
|
-
preventDefault(): void;
|
|
144
|
-
getData(): PanelTransfer | undefined;
|
|
145
|
-
constructor(event: WillShowOverlayEvent, options: WillShowOverlayLocationEventOptions);
|
|
146
|
-
}
|
|
147
126
|
export declare class DockviewGroupPanelModel extends CompositeDisposable implements IDockviewGroupPanelModel {
|
|
148
127
|
private readonly container;
|
|
149
128
|
private readonly accessor;
|
|
@@ -2,6 +2,7 @@ import { DockviewApi } from '../api/component.api';
|
|
|
2
2
|
import { getPanelData } from '../dnd/dataTransfer';
|
|
3
3
|
import { isAncestor, toggleClass } from '../dom';
|
|
4
4
|
import { addDisposableListener, DockviewEvent, Emitter, } from '../events';
|
|
5
|
+
import { WillShowOverlayLocationEvent } from './events';
|
|
5
6
|
import { CompositeDisposable } from '../lifecycle';
|
|
6
7
|
import { ContentContainer, } from './components/panel/content';
|
|
7
8
|
import { TabsContainer, } from './components/titlebar/tabsContainer';
|
|
@@ -39,39 +40,6 @@ export class DockviewWillDropEvent extends DockviewDidDropEvent {
|
|
|
39
40
|
this._kind = options.kind;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
export class WillShowOverlayLocationEvent {
|
|
43
|
-
get kind() {
|
|
44
|
-
return this.options.kind;
|
|
45
|
-
}
|
|
46
|
-
get nativeEvent() {
|
|
47
|
-
return this.event.nativeEvent;
|
|
48
|
-
}
|
|
49
|
-
get position() {
|
|
50
|
-
return this.event.position;
|
|
51
|
-
}
|
|
52
|
-
get defaultPrevented() {
|
|
53
|
-
return this.event.defaultPrevented;
|
|
54
|
-
}
|
|
55
|
-
get panel() {
|
|
56
|
-
return this.options.panel;
|
|
57
|
-
}
|
|
58
|
-
get api() {
|
|
59
|
-
return this.options.api;
|
|
60
|
-
}
|
|
61
|
-
get group() {
|
|
62
|
-
return this.options.group;
|
|
63
|
-
}
|
|
64
|
-
preventDefault() {
|
|
65
|
-
this.event.preventDefault();
|
|
66
|
-
}
|
|
67
|
-
getData() {
|
|
68
|
-
return this.options.getData();
|
|
69
|
-
}
|
|
70
|
-
constructor(event, options) {
|
|
71
|
-
this.event = event;
|
|
72
|
-
this.options = options;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
43
|
export class DockviewGroupPanelModel extends CompositeDisposable {
|
|
76
44
|
get element() {
|
|
77
45
|
throw new Error('dockview: not supported');
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Position, WillShowOverlayEvent } from '../dnd/droptarget';
|
|
2
|
+
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
3
|
+
import { DockviewApi } from '../api/component.api';
|
|
4
|
+
import { IDockviewPanel } from './dockviewPanel';
|
|
5
|
+
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
6
|
+
import { IDockviewEvent } from '../events';
|
|
7
|
+
export type DockviewGroupDropLocation = 'tab' | 'header_space' | 'content' | 'edge';
|
|
8
|
+
export interface WillShowOverlayLocationEventOptions {
|
|
9
|
+
readonly kind: DockviewGroupDropLocation;
|
|
10
|
+
readonly panel: IDockviewPanel | undefined;
|
|
11
|
+
readonly api: DockviewApi;
|
|
12
|
+
readonly group: DockviewGroupPanel | undefined;
|
|
13
|
+
getData: () => PanelTransfer | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare class WillShowOverlayLocationEvent implements IDockviewEvent {
|
|
16
|
+
private readonly event;
|
|
17
|
+
readonly options: WillShowOverlayLocationEventOptions;
|
|
18
|
+
get kind(): DockviewGroupDropLocation;
|
|
19
|
+
get nativeEvent(): DragEvent;
|
|
20
|
+
get position(): Position;
|
|
21
|
+
get defaultPrevented(): boolean;
|
|
22
|
+
get panel(): IDockviewPanel | undefined;
|
|
23
|
+
get api(): DockviewApi;
|
|
24
|
+
get group(): DockviewGroupPanel | undefined;
|
|
25
|
+
preventDefault(): void;
|
|
26
|
+
getData(): PanelTransfer | undefined;
|
|
27
|
+
constructor(event: WillShowOverlayEvent, options: WillShowOverlayLocationEventOptions);
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class WillShowOverlayLocationEvent {
|
|
2
|
+
get kind() {
|
|
3
|
+
return this.options.kind;
|
|
4
|
+
}
|
|
5
|
+
get nativeEvent() {
|
|
6
|
+
return this.event.nativeEvent;
|
|
7
|
+
}
|
|
8
|
+
get position() {
|
|
9
|
+
return this.event.position;
|
|
10
|
+
}
|
|
11
|
+
get defaultPrevented() {
|
|
12
|
+
return this.event.defaultPrevented;
|
|
13
|
+
}
|
|
14
|
+
get panel() {
|
|
15
|
+
return this.options.panel;
|
|
16
|
+
}
|
|
17
|
+
get api() {
|
|
18
|
+
return this.options.api;
|
|
19
|
+
}
|
|
20
|
+
get group() {
|
|
21
|
+
return this.options.group;
|
|
22
|
+
}
|
|
23
|
+
preventDefault() {
|
|
24
|
+
this.event.preventDefault();
|
|
25
|
+
}
|
|
26
|
+
getData() {
|
|
27
|
+
return this.options.getData();
|
|
28
|
+
}
|
|
29
|
+
constructor(event, options) {
|
|
30
|
+
this.event = event;
|
|
31
|
+
this.options = options;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -7,7 +7,8 @@ import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
|
7
7
|
import { PanelTransfer } from '../dnd/dataTransfer';
|
|
8
8
|
import { IDisposable } from '../lifecycle';
|
|
9
9
|
import { DroptargetOverlayModel, Position } from '../dnd/droptarget';
|
|
10
|
-
import {
|
|
10
|
+
import { GroupOptions } from './dockviewGroupPanelModel';
|
|
11
|
+
import { DockviewGroupDropLocation } from './events';
|
|
11
12
|
import { IDockviewPanel } from './dockviewPanel';
|
|
12
13
|
import { DockviewPanelRenderer } from '../overlay/overlayRenderContainer';
|
|
13
14
|
import { IGroupHeaderProps } from './framework';
|
package/dist/styles/dockview.css
CHANGED
|
@@ -292,6 +292,7 @@
|
|
|
292
292
|
--dv-active-sash-color: transparent;
|
|
293
293
|
--dv-active-sash-transition-duration: 0.1s;
|
|
294
294
|
--dv-active-sash-transition-delay: 0.5s;
|
|
295
|
+
box-sizing: border-box;
|
|
295
296
|
padding: 10px;
|
|
296
297
|
background-color: #ebeced;
|
|
297
298
|
--dv-group-view-background-color: #ebeced;
|
|
@@ -411,6 +412,7 @@
|
|
|
411
412
|
--dv-tab-margin: 0.5rem 0.25rem;
|
|
412
413
|
--dv-tabs-and-actions-container-height: 44px;
|
|
413
414
|
--dv-border-radius: 20px;
|
|
415
|
+
box-sizing: border-box;
|
|
414
416
|
--dv-color-abyss-dark: rgb(11, 6, 17);
|
|
415
417
|
--dv-color-abyss: #16121f;
|
|
416
418
|
--dv-color-abyss-light: #201d2b;
|
|
@@ -515,6 +517,7 @@
|
|
|
515
517
|
--dv-tab-margin: 0.5rem 0.25rem;
|
|
516
518
|
--dv-tabs-and-actions-container-height: 44px;
|
|
517
519
|
--dv-border-radius: 20px;
|
|
520
|
+
box-sizing: border-box;
|
|
518
521
|
--dv-drag-over-border: 2px solid rgb(91, 30, 207);
|
|
519
522
|
--dv-drag-over-background-color: "";
|
|
520
523
|
--dv-group-view-background-color: #f6f5f9;
|
|
@@ -1181,6 +1184,8 @@
|
|
|
1181
1184
|
.dv-tabs-and-actions-container .dv-void-container {
|
|
1182
1185
|
display: flex;
|
|
1183
1186
|
flex-grow: 1;
|
|
1187
|
+
}
|
|
1188
|
+
.dv-tabs-and-actions-container .dv-void-container.dv-draggable {
|
|
1184
1189
|
cursor: grab;
|
|
1185
1190
|
}
|
|
1186
1191
|
.dv-tabs-and-actions-container .dv-right-actions-container {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockview-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "Zero dependency layout manager supporting tabs, grids and splitviews",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"splitview",
|
|
@@ -41,14 +41,13 @@
|
|
|
41
41
|
"README.md"
|
|
42
42
|
],
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"build:bundles": "rollup -c",
|
|
44
|
+
"build:bundle": "rollup -c",
|
|
46
45
|
"build:cjs": "cross-env ../../node_modules/.bin/tsc --build ./tsconfig.json --verbose --extendedDiagnostics",
|
|
47
46
|
"build:css": "gulp sass",
|
|
48
47
|
"build:esm": "cross-env ../../node_modules/.bin/tsc --build ./tsconfig.esm.json --verbose --extendedDiagnostics",
|
|
49
|
-
"build
|
|
48
|
+
"build": "npm run build:cjs && npm run build:esm && npm run build:css",
|
|
50
49
|
"clean": "rimraf dist/ .build/ .rollup.cache/",
|
|
51
|
-
"prepublishOnly": "npm run rebuild && npm run test",
|
|
50
|
+
"prepublishOnly": "npm run rebuild && npm run build:bundle && npm run test",
|
|
52
51
|
"rebuild": "npm run clean && npm run build",
|
|
53
52
|
"test": "cross-env ../../node_modules/.bin/jest --selectProjects dockview-core",
|
|
54
53
|
"test:cov": "cross-env ../../node_modules/.bin/jest --selectProjects dockview-core --coverage"
|