dockview-core 4.1.0 → 4.2.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/dockview/components/titlebar/tabs.js +9 -3
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/cjs/dockview/dockviewComponent.js +37 -38
- package/dist/cjs/dockview/options.d.ts +7 -0
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/dockview-core.amd.js +50 -44
- 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 +49 -43
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +50 -44
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +50 -44
- 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 +50 -44
- 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 +49 -43
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/dockview/components/titlebar/tabs.js +9 -3
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.js +37 -38
- package/dist/esm/dockview/options.d.ts +7 -0
- package/dist/esm/dockview/options.js +1 -0
- package/dist/styles/dockview.css +16 -10
- package/package.json +1 -1
|
@@ -55,9 +55,15 @@ export class Tabs extends CompositeDisposable {
|
|
|
55
55
|
this._tabsList = document.createElement('div');
|
|
56
56
|
this._tabsList.className = 'dv-tabs-container dv-horizontal';
|
|
57
57
|
this.showTabsOverflowControl = options.showTabsOverflowControl;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
if (accessor.options.scrollbars === 'native') {
|
|
59
|
+
this._element = this._tabsList;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const scrollbar = new Scrollbar(this._tabsList);
|
|
63
|
+
this._element = scrollbar.element;
|
|
64
|
+
this.addDisposables(scrollbar);
|
|
65
|
+
}
|
|
66
|
+
this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
|
|
61
67
|
if (event.defaultPrevented) {
|
|
62
68
|
return;
|
|
63
69
|
}
|
|
@@ -58,7 +58,7 @@ export class TabsContainer extends CompositeDisposable {
|
|
|
58
58
|
this._element.appendChild(this.leftActionsContainer);
|
|
59
59
|
this._element.appendChild(this.voidContainer.element);
|
|
60
60
|
this._element.appendChild(this.rightActionsContainer);
|
|
61
|
-
this.addDisposables(accessor.onDidOptionsChange(() => {
|
|
61
|
+
this.addDisposables(this.tabs.onDrop((e) => this._onDrop.fire(e)), this.tabs.onWillShowOverlay((e) => this._onWillShowOverlay.fire(e)), accessor.onDidOptionsChange(() => {
|
|
62
62
|
this.tabs.showTabsOverflowControl =
|
|
63
63
|
!accessor.options.disableTabsOverflowList;
|
|
64
64
|
}), this.tabs.onOverflowTabsChange((event) => {
|
|
@@ -128,13 +128,48 @@ export class DockviewComponent extends BaseGrid {
|
|
|
128
128
|
this._onDidActiveGroupChange = new Emitter();
|
|
129
129
|
this.onDidActiveGroupChange = this._onDidActiveGroupChange.event;
|
|
130
130
|
this._moving = false;
|
|
131
|
+
this._options = options;
|
|
131
132
|
this.popupService = new PopupService(this.element);
|
|
132
|
-
this.updateDropTargetModel(options);
|
|
133
133
|
this._themeClassnames = new Classnames(this.element);
|
|
134
|
+
this._api = new DockviewApi(this);
|
|
134
135
|
this.rootDropTargetContainer = new DropTargetAnchorContainer(this.element, { disabled: true });
|
|
135
136
|
this.overlayRenderContainer = new OverlayRenderContainer(this.gridview.element, this);
|
|
137
|
+
this._rootDropTarget = new Droptarget(this.element, {
|
|
138
|
+
className: 'dv-drop-target-edge',
|
|
139
|
+
canDisplayOverlay: (event, position) => {
|
|
140
|
+
const data = getPanelData();
|
|
141
|
+
if (data) {
|
|
142
|
+
if (data.viewId !== this.id) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
if (position === 'center') {
|
|
146
|
+
// center drop target is only allowed if there are no panels in the grid
|
|
147
|
+
// floating panels are allowed
|
|
148
|
+
return this.gridview.length === 0;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (position === 'center' && this.gridview.length !== 0) {
|
|
153
|
+
/**
|
|
154
|
+
* for external events only show the four-corner drag overlays, disable
|
|
155
|
+
* the center position so that external drag events can fall through to the group
|
|
156
|
+
* and panel drop target handlers
|
|
157
|
+
*/
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
|
|
161
|
+
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
162
|
+
return firedEvent.isAccepted;
|
|
163
|
+
},
|
|
164
|
+
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
165
|
+
overlayModel: (_c = options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
166
|
+
getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
|
|
167
|
+
});
|
|
168
|
+
this.updateDropTargetModel(options);
|
|
136
169
|
toggleClass(this.gridview.element, 'dv-dockview', true);
|
|
137
170
|
toggleClass(this.element, 'dv-debug', !!options.debug);
|
|
171
|
+
this.updateTheme();
|
|
172
|
+
this.updateWatermark();
|
|
138
173
|
if (options.debug) {
|
|
139
174
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
140
175
|
}
|
|
@@ -170,41 +205,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
170
205
|
for (const group of [...this._popoutGroups]) {
|
|
171
206
|
group.disposable.dispose();
|
|
172
207
|
}
|
|
173
|
-
}))
|
|
174
|
-
this._options = options;
|
|
175
|
-
this.updateTheme();
|
|
176
|
-
this._rootDropTarget = new Droptarget(this.element, {
|
|
177
|
-
className: 'dv-drop-target-edge',
|
|
178
|
-
canDisplayOverlay: (event, position) => {
|
|
179
|
-
const data = getPanelData();
|
|
180
|
-
if (data) {
|
|
181
|
-
if (data.viewId !== this.id) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
if (position === 'center') {
|
|
185
|
-
// center drop target is only allowed if there are no panels in the grid
|
|
186
|
-
// floating panels are allowed
|
|
187
|
-
return this.gridview.length === 0;
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
}
|
|
191
|
-
if (position === 'center' && this.gridview.length !== 0) {
|
|
192
|
-
/**
|
|
193
|
-
* for external events only show the four-corner drag overlays, disable
|
|
194
|
-
* the center position so that external drag events can fall through to the group
|
|
195
|
-
* and panel drop target handlers
|
|
196
|
-
*/
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
const firedEvent = new DockviewUnhandledDragOverEvent(event, 'edge', position, getPanelData);
|
|
200
|
-
this._onUnhandledDragOverEvent.fire(firedEvent);
|
|
201
|
-
return firedEvent.isAccepted;
|
|
202
|
-
},
|
|
203
|
-
acceptedTargetZones: ['top', 'bottom', 'left', 'right', 'center'],
|
|
204
|
-
overlayModel: (_c = this.options.rootOverlayModel) !== null && _c !== void 0 ? _c : DEFAULT_ROOT_OVERLAY_MODEL,
|
|
205
|
-
getOverrideTarget: () => { var _a; return (_a = this.rootDropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; },
|
|
206
|
-
});
|
|
207
|
-
this.addDisposables(this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
208
|
+
}), this._rootDropTarget, this._rootDropTarget.onWillShowOverlay((event) => {
|
|
208
209
|
if (this.gridview.length > 0 && event.position === 'center') {
|
|
209
210
|
// option only available when no panels in primary grid
|
|
210
211
|
return;
|
|
@@ -255,8 +256,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
255
256
|
}));
|
|
256
257
|
}
|
|
257
258
|
}), this._rootDropTarget);
|
|
258
|
-
this._api = new DockviewApi(this);
|
|
259
|
-
this.updateWatermark();
|
|
260
259
|
}
|
|
261
260
|
setVisible(panel, visible) {
|
|
262
261
|
switch (panel.api.location.type) {
|
|
@@ -58,6 +58,13 @@ export interface DockviewOptions {
|
|
|
58
58
|
noPanelsOverlay?: 'emptyGroup' | 'watermark';
|
|
59
59
|
theme?: DockviewTheme;
|
|
60
60
|
disableTabsOverflowList?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Select `native` to use built-in scrollbar behaviours and `custom` to use an internal implementation
|
|
63
|
+
* that allows for improved scrollbar overlay UX.
|
|
64
|
+
*
|
|
65
|
+
* This is only applied to the tab header section. Defaults to `custom`.
|
|
66
|
+
*/
|
|
67
|
+
scrollbars?: 'native' | 'custom';
|
|
61
68
|
}
|
|
62
69
|
export interface DockviewDndOverlayEvent extends IAcceptableEvent {
|
|
63
70
|
nativeEvent: DragEvent;
|
package/dist/styles/dockview.css
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.dv-scrollable {
|
|
2
2
|
position: relative;
|
|
3
3
|
overflow: hidden;
|
|
4
|
-
width: 100%;
|
|
5
4
|
}
|
|
6
5
|
.dv-scrollable .dv-scrollbar-horizontal {
|
|
7
6
|
position: absolute;
|
|
@@ -249,10 +248,10 @@
|
|
|
249
248
|
opacity: 0;
|
|
250
249
|
transition: none;
|
|
251
250
|
}
|
|
252
|
-
.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container
|
|
251
|
+
.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {
|
|
253
252
|
position: relative;
|
|
254
253
|
}
|
|
255
|
-
.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container
|
|
254
|
+
.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {
|
|
256
255
|
position: absolute;
|
|
257
256
|
left: 0px;
|
|
258
257
|
top: 0px;
|
|
@@ -262,10 +261,10 @@
|
|
|
262
261
|
background-color: #94527e;
|
|
263
262
|
z-index: 999;
|
|
264
263
|
}
|
|
265
|
-
.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container
|
|
264
|
+
.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {
|
|
266
265
|
position: relative;
|
|
267
266
|
}
|
|
268
|
-
.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container
|
|
267
|
+
.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {
|
|
269
268
|
position: absolute;
|
|
270
269
|
left: 0px;
|
|
271
270
|
bottom: 0px;
|
|
@@ -647,19 +646,19 @@
|
|
|
647
646
|
position: relative;
|
|
648
647
|
}
|
|
649
648
|
|
|
650
|
-
.dv-groupview.dv-active-group > .dv-tabs-and-actions-container
|
|
649
|
+
.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {
|
|
651
650
|
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
652
651
|
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
653
652
|
}
|
|
654
|
-
.dv-groupview.dv-active-group > .dv-tabs-and-actions-container
|
|
653
|
+
.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {
|
|
655
654
|
background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);
|
|
656
655
|
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
|
657
656
|
}
|
|
658
|
-
.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container
|
|
657
|
+
.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {
|
|
659
658
|
background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);
|
|
660
659
|
color: var(--dv-inactivegroup-visiblepanel-tab-color);
|
|
661
660
|
}
|
|
662
|
-
.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container
|
|
661
|
+
.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {
|
|
663
662
|
background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);
|
|
664
663
|
color: var(--dv-inactivegroup-hiddenpanel-tab-color);
|
|
665
664
|
}
|
|
@@ -1100,7 +1099,7 @@
|
|
|
1100
1099
|
.dv-tabs-container {
|
|
1101
1100
|
display: flex;
|
|
1102
1101
|
height: 100%;
|
|
1103
|
-
overflow:
|
|
1102
|
+
overflow: auto;
|
|
1104
1103
|
scrollbar-width: thin;
|
|
1105
1104
|
/* Track */
|
|
1106
1105
|
/* Handle */
|
|
@@ -1126,6 +1125,10 @@
|
|
|
1126
1125
|
background: var(--dv-tabs-container-scrollbar-color);
|
|
1127
1126
|
}
|
|
1128
1127
|
|
|
1128
|
+
.dv-scrollable > .dv-tabs-container {
|
|
1129
|
+
overflow: hidden;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1129
1132
|
.dv-tab {
|
|
1130
1133
|
-webkit-user-drag: element;
|
|
1131
1134
|
outline: none;
|
|
@@ -1162,6 +1165,9 @@
|
|
|
1162
1165
|
height: var(--dv-tabs-and-actions-container-height);
|
|
1163
1166
|
font-size: var(--dv-tabs-and-actions-container-font-size);
|
|
1164
1167
|
}
|
|
1168
|
+
.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-scrollable {
|
|
1169
|
+
flex-grow: 1;
|
|
1170
|
+
}
|
|
1165
1171
|
.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container {
|
|
1166
1172
|
flex-grow: 1;
|
|
1167
1173
|
}
|