Skip to content

Commit 552026c

Browse files
committed
feat:update dockview version to v4.4.0
1 parent 7c48c51 commit 552026c

3 files changed

Lines changed: 39 additions & 17 deletions

File tree

src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,10 @@
11291129
.dv-tabs-and-actions-container .dv-right-actions-container {
11301130
display: flex;
11311131
}
1132+
.dv-watermark {
1133+
display: flex;
1134+
height: 100%;
1135+
}
11321136
.dv-dragged {
11331137
transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */
11341138
}
@@ -1185,8 +1189,4 @@
11851189
.dv-tab .dv-default-tab .dv-default-tab-action:hover {
11861190
border-radius: 2px;
11871191
background-color: var(--dv-icon-hover-background-color);
1188-
}
1189-
.dv-watermark {
1190-
display: flex;
1191-
height: 100%;
11921192
}

src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* dockview-core
3-
* @version 4.3.1
3+
* @version 4.4.0
44
* @link https://github.com/mathuo/dockview
55
* @license MIT
66
*/
@@ -3619,6 +3619,9 @@ class DockviewApi {
36193619
get onDidPopoutGroupPositionChange() {
36203620
return this.component.onDidPopoutGroupPositionChange;
36213621
}
3622+
get onDidOpenPopoutWindowFail() {
3623+
return this.component.onDidOpenPopoutWindowFail;
3624+
}
36223625
/**
36233626
* All panel objects.
36243627
*/
@@ -8351,6 +8354,8 @@ class DockviewComponent extends BaseGrid {
83518354
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
83528355
this._onDidPopoutGroupPositionChange = new Emitter();
83538356
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
8357+
this._onDidOpenPopoutWindowFail = new Emitter();
8358+
this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
83548359
this._onDidLayoutFromJSON = new Emitter();
83558360
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
83568361
this._onDidActivePanelChange = new Emitter({ replay: true });
@@ -8415,7 +8420,7 @@ class DockviewComponent extends BaseGrid {
84158420
if (options.debug) {
84168421
this.addDisposables(new StrictEventsSequencing(this));
84178422
}
8418-
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(() => {
8423+
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(() => {
84198424
this.updateWatermark();
84208425
}), this.onDidAdd((event) => {
84218426
if (!this._moving) {
@@ -8565,21 +8570,14 @@ class DockviewComponent extends BaseGrid {
85658570
if (_window.isDisposed) {
85668571
return false;
85678572
}
8568-
if (popoutContainer === null) {
8569-
popoutWindowDisposable.dispose();
8570-
return false;
8571-
}
8572-
const gready = document.createElement('div');
8573-
gready.className = 'dv-overlay-render-container';
8574-
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
85758573
const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
85768574
? options.referenceGroup
85778575
: itemToPopout instanceof DockviewPanel
85788576
? itemToPopout.group
85798577
: itemToPopout;
85808578
const referenceLocation = itemToPopout.api.location.type;
85818579
/**
8582-
* The group that is being added doesn't already exist within the DOM, the most likely occurance
8580+
* The group that is being added doesn't already exist within the DOM, the most likely occurrence
85838581
* of this case is when being called from the `fromJSON(...)` method
85848582
*/
85858583
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
@@ -8592,8 +8590,28 @@ class DockviewComponent extends BaseGrid {
85928590
}
85938591
else {
85948592
group = this.createGroup({ id: groupId });
8595-
this._onDidAddGroup.fire(group);
8593+
if (popoutContainer) {
8594+
this._onDidAddGroup.fire(group);
8595+
}
85968596
}
8597+
if (popoutContainer === null) {
8598+
console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
8599+
popoutWindowDisposable.dispose();
8600+
this._onDidOpenPopoutWindowFail.fire();
8601+
// if the popout window was blocked, we need to move the group back to the reference group
8602+
// and set it to visible
8603+
this.movingLock(() => moveGroupWithoutDestroying({
8604+
from: group,
8605+
to: referenceGroup,
8606+
}));
8607+
if (!referenceGroup.api.isVisible) {
8608+
referenceGroup.api.setVisible(true);
8609+
}
8610+
return false;
8611+
}
8612+
const gready = document.createElement('div');
8613+
gready.className = 'dv-overlay-render-container';
8614+
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
85978615
group.model.renderContainer = overlayRenderContainer;
85988616
group.layout(_window.window.innerWidth, _window.window.innerHeight);
85998617
let floatingBox;
@@ -8750,7 +8768,7 @@ class DockviewComponent extends BaseGrid {
87508768
return true;
87518769
})
87528770
.catch((err) => {
8753-
console.error('dockview: failed to create popout window', err);
8771+
console.error('dockview: failed to create popout.', err);
87548772
return false;
87558773
});
87568774
}

src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ const initDockview = (dockview, options, template) => {
9191
const delPanelsStr = localStorage.getItem(dockview.params.options.localStorageKey + '-panels')
9292
const delPanels = delPanelsStr && JSON.parse(delPanelsStr) || []
9393
panels.forEach(panel => {
94-
dockview._panelVisibleChanged?.fire({ title: panel.title, status: true });
94+
const visible = panel.params.visible
95+
if (!visible) {
96+
dockview.removePanel(panel)
97+
}
98+
dockview._panelVisibleChanged?.fire({ title: panel.title, status: visible });
9599
})
96100
delPanels.forEach(panel => {
97101
dockview._panelVisibleChanged?.fire({ title: panel.title, status: false });

0 commit comments

Comments
 (0)