From d2c203a572a0b0d9e243b1bbbcfbcc9adc3e7240 Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Tue, 10 Jun 2025 09:53:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore=EF=BC=9Aupdate=20dockview=20to=20v4.3?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/css/dockview.css | 122 +++++++++--------- .../wwwroot/js/dockview-core.esm.js | 44 ++++--- 2 files changed, 85 insertions(+), 81 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css b/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css index 7b5b574d..54e87001 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css +++ b/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css @@ -1023,67 +1023,6 @@ pointer-events: none; background-color: var(--dv-separator-border); } -.dv-dragged { - transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */ -} - -.dv-tab { - flex-shrink: 0; -} -.dv-tab:focus-within, .dv-tab:focus { - position: relative; -} -.dv-tab:focus-within::after, .dv-tab:focus::after { - position: absolute; - content: ""; - height: 100%; - width: 100%; - top: 0px; - left: 0px; - pointer-events: none; - outline: 1px solid var(--dv-tab-divider-color) !important; - outline-offset: -1px; - z-index: 5; -} -.dv-tab.dv-tab-dragging .dv-default-tab-action { - background-color: var(--dv-activegroup-visiblepanel-tab-color); -} -.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action { - visibility: visible; -} -.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action { - visibility: hidden; -} -.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action { - visibility: visible; -} -.dv-tab .dv-default-tab { - position: relative; - height: 100%; - display: flex; - align-items: center; - white-space: nowrap; - text-overflow: ellipsis; -} -.dv-tab .dv-default-tab .dv-default-tab-content { - flex-grow: 1; - margin-right: 4px; -} -.dv-tab .dv-default-tab .dv-default-tab-action { - padding: 4px; - display: flex; - align-items: center; - justify-content: center; - box-sizing: border-box; -} -.dv-tab .dv-default-tab .dv-default-tab-action:hover { - border-radius: 2px; - background-color: var(--dv-icon-hover-background-color); -} -.dv-watermark { - display: flex; - height: 100%; -} .dv-tabs-overflow-dropdown-default { height: 100%; color: var(--dv-activegroup-hiddenpanel-tab-color); @@ -1189,4 +1128,65 @@ } .dv-tabs-and-actions-container .dv-right-actions-container { display: flex; +} +.dv-dragged { + transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */ +} + +.dv-tab { + flex-shrink: 0; +} +.dv-tab:focus-within, .dv-tab:focus { + position: relative; +} +.dv-tab:focus-within::after, .dv-tab:focus::after { + position: absolute; + content: ""; + height: 100%; + width: 100%; + top: 0px; + left: 0px; + pointer-events: none; + outline: 1px solid var(--dv-tab-divider-color) !important; + outline-offset: -1px; + z-index: 5; +} +.dv-tab.dv-tab-dragging .dv-default-tab-action { + background-color: var(--dv-activegroup-visiblepanel-tab-color); +} +.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action { + visibility: visible; +} +.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action { + visibility: hidden; +} +.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action { + visibility: visible; +} +.dv-tab .dv-default-tab { + position: relative; + height: 100%; + display: flex; + align-items: center; + white-space: nowrap; + text-overflow: ellipsis; +} +.dv-tab .dv-default-tab .dv-default-tab-content { + flex-grow: 1; + margin-right: 4px; +} +.dv-tab .dv-default-tab .dv-default-tab-action { + padding: 4px; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; +} +.dv-tab .dv-default-tab .dv-default-tab-action:hover { + border-radius: 2px; + background-color: var(--dv-icon-hover-background-color); +} +.dv-watermark { + display: flex; + height: 100%; } \ No newline at end of file diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js index ed4271be..3f09b01c 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js @@ -1,6 +1,6 @@ /** * dockview-core - * @version 4.2.5 + * @version 4.3.1 * @link https://github.com/mathuo/dockview * @license MIT */ @@ -185,7 +185,10 @@ class Emitter { return this._event; } fire(e) { - this._last = e; + var _a; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.replay) { + this._last = e; + } for (const listener of this._listeners) { listener.callback(e); } @@ -3950,9 +3953,9 @@ class Droptarget extends CompositeDisposable { onDragOver: (e) => { var _a, _b, _c, _d, _e, _f, _g; Droptarget.ACTUAL_TARGET = this; - const overrideTraget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a); + const overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a); if (this._acceptedTargetZonesSet.size === 0) { - if (overrideTraget) { + if (overrideTarget) { return; } this.removeDropTarget(); @@ -3979,7 +3982,7 @@ class Droptarget extends CompositeDisposable { return; } if (!this.options.canDisplayOverlay(e, quadrant)) { - if (overrideTraget) { + if (overrideTarget) { return; } this.removeDropTarget(); @@ -3999,7 +4002,7 @@ class Droptarget extends CompositeDisposable { return; } this.markAsUsed(e); - if (overrideTraget) ; + if (overrideTarget) ; else if (!this.targetElement) { this.targetElement = document.createElement('div'); this.targetElement.className = 'dv-drop-target-dropzone'; @@ -5108,7 +5111,7 @@ class VoidContainer extends CompositeDisposable { this.accessor.doSetGroupActive(this.group); })); const handler = new GroupDragHandler(this._element, accessor, group); - this.dropTraget = new Droptarget(this._element, { + this.dropTarget = new Droptarget(this._element, { acceptedTargetZones: ['center'], canDisplayOverlay: (event, position) => { const data = getPanelData(); @@ -5119,12 +5122,12 @@ class VoidContainer extends CompositeDisposable { }, getOverrideTarget: () => { var _a; return (_a = group.model.dropTargetContainer) === null || _a === void 0 ? void 0 : _a.model; }, }); - this.onWillShowOverlay = this.dropTraget.onWillShowOverlay; + this.onWillShowOverlay = this.dropTarget.onWillShowOverlay; this.addDisposables(handler, handler.onDragStart((event) => { this._onDragStart.fire(event); - }), this.dropTraget.onDrop((event) => { + }), this.dropTarget.onDrop((event) => { this._onDrop.fire(event); - }), this.dropTraget); + }), this.dropTarget); } } @@ -8350,7 +8353,7 @@ class DockviewComponent extends BaseGrid { this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event; this._onDidLayoutFromJSON = new Emitter(); this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event; - this._onDidActivePanelChange = new Emitter(); + this._onDidActivePanelChange = new Emitter({ replay: true }); this.onDidActivePanelChange = this._onDidActivePanelChange.event; this._onDidMovePanel = new Emitter(); this.onDidMovePanel = this._onDidMovePanel.event; @@ -8569,9 +8572,11 @@ class DockviewComponent extends BaseGrid { const gready = document.createElement('div'); gready.className = 'dv-overlay-render-container'; const overlayRenderContainer = new OverlayRenderContainer(gready, this); - const referenceGroup = itemToPopout instanceof DockviewPanel - ? itemToPopout.group - : itemToPopout; + const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup) + ? options.referenceGroup + : itemToPopout instanceof DockviewPanel + ? itemToPopout.group + : itemToPopout; const referenceLocation = itemToPopout.api.location.type; /** * The group that is being added doesn't already exist within the DOM, the most likely occurance @@ -9063,7 +9068,7 @@ class DockviewComponent extends BaseGrid { return result; } fromJSON(data) { - var _a, _b, _c; + var _a, _b; this.clear(); if (typeof data !== 'object' || data === null) { throw new Error('serialized layout must be a non-null object'); @@ -9135,12 +9140,11 @@ class DockviewComponent extends BaseGrid { for (const serializedPopoutGroup of serializedPopoutGroups) { const { data, position, gridReferenceGroup, url } = serializedPopoutGroup; const group = createGroupFromSerializedState(data); - this.addPopoutGroup((_c = (gridReferenceGroup - ? this.getPanel(gridReferenceGroup) - : undefined)) !== null && _c !== void 0 ? _c : group, { + this.addPopoutGroup(group, { position: position !== null && position !== void 0 ? position : undefined, - overridePopoutGroup: gridReferenceGroup - ? group + overridePopoutGroup: gridReferenceGroup ? group : undefined, + referenceGroup: gridReferenceGroup + ? this.getPanel(gridReferenceGroup) : undefined, popoutUrl: url, }); From 051fa77d122a80d8ad1cc5054fe6ec4888c7cf96 Mon Sep 17 00:00:00 2001 From: zhaijunlei955 <276318515@qq.com> Date: Mon, 16 Jun 2025 17:18:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9Adockview=E6=B5=AE=E5=8A=A8?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=94=B6=E8=B5=B7=E6=97=B6=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=B6=85=E5=87=BA=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css | 4 ++++ .../BootstrapBlazor.DockView/wwwroot/js/dockview-group.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css b/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css index 1043d59e..6c949a69 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css +++ b/src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css @@ -276,3 +276,7 @@ .bb-dockview .dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action { visibility: visible; } + +.bb-dockview .bb-overflowHidden { + overflow: hidden; +} \ No newline at end of file diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js index a2d4d939..da3689a0 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-group.js @@ -172,6 +172,9 @@ const createGroupActions = (group, groupType) => { setTimeout(() => { groupType = groupType || group.getParams()?.floatType resetActionStates(group, actionContainer, groupType); + if (showUp(group) && getUpState(group)) { + group.panels.forEach(panel => panel.view.content.element.classList.add('bb-overflowHidden')) + } }, 0) addActionEvent(group, actionContainer); } @@ -618,6 +621,7 @@ const down = (group, actionContainer) => { parentEle.style.bottom = parseFloat(bottom) - (packup.height - tabHeight) + 'px' } actionContainer.classList.add('bb-up'); + group.panels.forEach(panel => panel.view.content.element.classList.remove('bb-overflowHidden')) } else { group.setParams({ packup: { isPackup: true, height: parseFloat(height) } }); @@ -626,6 +630,7 @@ const down = (group, actionContainer) => { parentEle.style.bottom = parseFloat(bottom) + (parseFloat(height) - tabHeight) + 'px' } actionContainer.classList.remove('bb-up') + group.panels.forEach(panel => panel.view.content.element.classList.add('bb-overflowHidden')) } saveConfig(group.api.accessor) }