Skip to content

Commit 18bafd1

Browse files
authored
Merge branch 'master' into graph
2 parents a680f6a + fdc5558 commit 18bafd1

8 files changed

Lines changed: 261 additions & 79 deletions

File tree

BootstrapBlazor.Extensions.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Authenticat
184184
EndProject
185185
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Graph", "src\components\BootstrapBlazor.Graph\BootstrapBlazor.Graph.csproj", "{CED55D86-57CF-CB0D-E880-370C44C0DB1F}"
186186
EndProject
187+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Html2Pdf.Playwright", "src\components\BootstrapBlazor.Html2Pdf.Playwright\BootstrapBlazor.Html2Pdf.Playwright.csproj", "{F3043A78-1942-4524-BDC4-7E88F56DF3D5}"
188+
EndProject
187189
Global
188190
GlobalSection(SolutionConfigurationPlatforms) = preSolution
189191
Debug|Any CPU = Debug|Any CPU
@@ -498,6 +500,10 @@ Global
498500
{CED55D86-57CF-CB0D-E880-370C44C0DB1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
499501
{CED55D86-57CF-CB0D-E880-370C44C0DB1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
500502
{CED55D86-57CF-CB0D-E880-370C44C0DB1F}.Release|Any CPU.Build.0 = Release|Any CPU
503+
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
504+
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
505+
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
506+
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Release|Any CPU.Build.0 = Release|Any CPU
501507
EndGlobalSection
502508
GlobalSection(SolutionProperties) = preSolution
503509
HideSolutionNode = FALSE
@@ -584,6 +590,7 @@ Global
584590
{2F37FBF4-5C1C-4493-B614-0E8361432621} = {FF1089BE-C704-4374-B629-C57C08E1798F}
585591
{1FDDF0AD-7AB6-4706-A183-26C680817BB4} = {FF1089BE-C704-4374-B629-C57C08E1798F}
586592
{CED55D86-57CF-CB0D-E880-370C44C0DB1F} = {FF1089BE-C704-4374-B629-C57C08E1798F}
593+
{F3043A78-1942-4524-BDC4-7E88F56DF3D5} = {FF1089BE-C704-4374-B629-C57C08E1798F}
587594
EndGlobalSection
588595
GlobalSection(ExtensibilityGlobals) = postSolution
589596
SolutionGuid = {D5EB1960-6F30-4CE1-B375-EAE1F787D6FF}

src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.1.12</Version>
4+
<Version>9.1.13</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

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

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,15 @@
686686
min-height: 0;
687687
outline: none;
688688
}
689+
.dv-root-wrapper {
690+
height: 100%;
691+
width: 100%;
692+
}
693+
.dv-grid-view,
694+
.dv-branch-node {
695+
height: 100%;
696+
width: 100%;
697+
}
689698
.dv-debug .dv-resize-container .dv-resize-handle-top {
690699
background-color: red;
691700
}
@@ -804,15 +813,6 @@
804813
outline: 1px solid red;
805814
outline-offset: -1;
806815
}
807-
.dv-root-wrapper {
808-
height: 100%;
809-
width: 100%;
810-
}
811-
.dv-grid-view,
812-
.dv-branch-node {
813-
height: 100%;
814-
width: 100%;
815-
}
816816
.dv-pane-container {
817817
height: 100%;
818818
width: 100%;
@@ -1023,6 +1023,67 @@
10231023
pointer-events: none;
10241024
background-color: var(--dv-separator-border);
10251025
}
1026+
.dv-dragged {
1027+
transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */
1028+
}
1029+
1030+
.dv-tab {
1031+
flex-shrink: 0;
1032+
}
1033+
.dv-tab:focus-within, .dv-tab:focus {
1034+
position: relative;
1035+
}
1036+
.dv-tab:focus-within::after, .dv-tab:focus::after {
1037+
position: absolute;
1038+
content: "";
1039+
height: 100%;
1040+
width: 100%;
1041+
top: 0px;
1042+
left: 0px;
1043+
pointer-events: none;
1044+
outline: 1px solid var(--dv-tab-divider-color) !important;
1045+
outline-offset: -1px;
1046+
z-index: 5;
1047+
}
1048+
.dv-tab.dv-tab-dragging .dv-default-tab-action {
1049+
background-color: var(--dv-activegroup-visiblepanel-tab-color);
1050+
}
1051+
.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action {
1052+
visibility: visible;
1053+
}
1054+
.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {
1055+
visibility: hidden;
1056+
}
1057+
.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action {
1058+
visibility: visible;
1059+
}
1060+
.dv-tab .dv-default-tab {
1061+
position: relative;
1062+
height: 100%;
1063+
display: flex;
1064+
align-items: center;
1065+
white-space: nowrap;
1066+
text-overflow: ellipsis;
1067+
}
1068+
.dv-tab .dv-default-tab .dv-default-tab-content {
1069+
flex-grow: 1;
1070+
margin-right: 4px;
1071+
}
1072+
.dv-tab .dv-default-tab .dv-default-tab-action {
1073+
padding: 4px;
1074+
display: flex;
1075+
align-items: center;
1076+
justify-content: center;
1077+
box-sizing: border-box;
1078+
}
1079+
.dv-tab .dv-default-tab .dv-default-tab-action:hover {
1080+
border-radius: 2px;
1081+
background-color: var(--dv-icon-hover-background-color);
1082+
}
1083+
.dv-watermark {
1084+
display: flex;
1085+
height: 100%;
1086+
}
10261087
.dv-tabs-overflow-dropdown-default {
10271088
height: 100%;
10281089
color: var(--dv-activegroup-hiddenpanel-tab-color);
@@ -1128,65 +1189,4 @@
11281189
}
11291190
.dv-tabs-and-actions-container .dv-right-actions-container {
11301191
display: flex;
1131-
}
1132-
.dv-dragged {
1133-
transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */
1134-
}
1135-
1136-
.dv-tab {
1137-
flex-shrink: 0;
1138-
}
1139-
.dv-tab:focus-within, .dv-tab:focus {
1140-
position: relative;
1141-
}
1142-
.dv-tab:focus-within::after, .dv-tab:focus::after {
1143-
position: absolute;
1144-
content: "";
1145-
height: 100%;
1146-
width: 100%;
1147-
top: 0px;
1148-
left: 0px;
1149-
pointer-events: none;
1150-
outline: 1px solid var(--dv-tab-divider-color) !important;
1151-
outline-offset: -1px;
1152-
z-index: 5;
1153-
}
1154-
.dv-tab.dv-tab-dragging .dv-default-tab-action {
1155-
background-color: var(--dv-activegroup-visiblepanel-tab-color);
1156-
}
1157-
.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action {
1158-
visibility: visible;
1159-
}
1160-
.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {
1161-
visibility: hidden;
1162-
}
1163-
.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action {
1164-
visibility: visible;
1165-
}
1166-
.dv-tab .dv-default-tab {
1167-
position: relative;
1168-
height: 100%;
1169-
display: flex;
1170-
align-items: center;
1171-
white-space: nowrap;
1172-
text-overflow: ellipsis;
1173-
}
1174-
.dv-tab .dv-default-tab .dv-default-tab-content {
1175-
flex-grow: 1;
1176-
margin-right: 4px;
1177-
}
1178-
.dv-tab .dv-default-tab .dv-default-tab-action {
1179-
padding: 4px;
1180-
display: flex;
1181-
align-items: center;
1182-
justify-content: center;
1183-
box-sizing: border-box;
1184-
}
1185-
.dv-tab .dv-default-tab .dv-default-tab-action:hover {
1186-
border-radius: 2px;
1187-
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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* dockview-core
3-
* @version 4.2.4
3+
* @version 4.2.5
44
* @link https://github.com/mathuo/dockview
55
* @license MIT
66
*/
@@ -639,9 +639,7 @@ function onDidWindowResizeEnd(element, cb) {
639639
function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
640640
const buffer = options.buffer;
641641
const rect = element.getBoundingClientRect();
642-
const rootRect = element.getBoundingClientRect();
643-
const viewportWidth = root.clientWidth;
644-
const viewportHeight = root.clientHeight;
642+
const rootRect = root.getBoundingClientRect();
645643
let translateX = 0;
646644
let translateY = 0;
647645
const left = rect.left - rootRect.left;
@@ -652,15 +650,15 @@ function shiftAbsoluteElementIntoView(element, root, options = { buffer: 10 }) {
652650
if (left < buffer) {
653651
translateX = buffer - left;
654652
}
655-
else if (right > viewportWidth - buffer) {
656-
translateX = viewportWidth - right - buffer;
653+
else if (right > buffer) {
654+
translateX = -buffer - right;
657655
}
658656
// Check vertical overflow
659657
if (top < buffer) {
660658
translateY = buffer - top;
661659
}
662-
else if (bottom > viewportHeight - buffer) {
663-
translateY = viewportHeight - bottom - buffer;
660+
else if (bottom > buffer) {
661+
translateY = -bottom - buffer;
664662
}
665663
// Apply the translation if needed
666664
if (translateX !== 0 || translateY !== 0) {
@@ -4940,6 +4938,8 @@ function addGhostImage(dataTransfer, ghostElement, options) {
49404938
var _a, _b;
49414939
// class dockview provides to force ghost image to be drawn on a different layer and prevent weird rendering issues
49424940
addClasses(ghostElement, 'dv-dragged');
4941+
// move the element off-screen initially otherwise it may in some cases be rendered at (0,0) momentarily
4942+
ghostElement.style.top = '-9999px';
49434943
document.body.appendChild(ghostElement);
49444944
dataTransfer.setDragImage(ghostElement, (_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0, (_b = options === null || options === void 0 ? void 0 : options.y) !== null && _b !== void 0 ? _b : 0);
49454945
setTimeout(() => {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<Version>9.0.0</Version>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Pdf</PackageTags>
9+
<Description>Bootstrap UI components extensions of Html2Pdf use Playwright lib</Description>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="BootstrapBlazor" Version="$(BBVersion)" />
14+
<PackageReference Include="Microsoft.Playwright" Version="1.52.0" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
using BootstrapBlazor.Components;
6+
7+
namespace Microsoft.Extensions.DependencyInjection;
8+
9+
/// <summary>
10+
/// BootstrapBlazor 服务扩展类
11+
/// </summary>
12+
public static class BootstrapBlazorHtml2PdfServiceExtensions
13+
{
14+
/// <summary>
15+
/// 添加 AzureOpenAIService 服务
16+
/// </summary>
17+
/// <param name="services"></param>
18+
public static IServiceCollection AddBootstrapBlazorHtml2PdfUsePlaywrightService(this IServiceCollection services)
19+
{
20+
services.AddSingleton<IHtml2Pdf, DefaultPdfService>();
21+
#if NET8_0_OR_GREATER
22+
services.AddKeyedSingleton<IHtml2Pdf, DefaultPdfService>("BootstrapBlazor.Html2Pdf.Playwright");
23+
#endif
24+
return services;
25+
}
26+
}

0 commit comments

Comments
 (0)