From 1f8ce14f7f08d9f6cc7ce0c9d32464e63bffeaca Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 7 Nov 2025 16:37:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20ClassStrin?= =?UTF-8?q?g=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.SummerNote/Components/Editor/Editor.razor | 2 +- .../Components/Editor/Editor.razor.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor index 6b88d260..dfce498f 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor @@ -7,6 +7,6 @@ { } -
+
diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs index aa397c8c..d1fef60d 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs @@ -13,6 +13,10 @@ namespace BootstrapBlazor.Components; /// public partial class Editor { + private string? ClassString => CssBuilder.Default("editor") + .AddClass(CssClass).AddClass(ValidCss) + .Build(); + /// /// 获得 Editor 样式 /// From f91af937c282e831470f895aa9794bea185d4f0a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 7 Nov 2025 16:38:09 +0800 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/css/editor.css | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.SummerNote/wwwroot/css/editor.css b/src/components/BootstrapBlazor.SummerNote/wwwroot/css/editor.css index 3df9f422..6cd4a8be 100644 --- a/src/components/BootstrapBlazor.SummerNote/wwwroot/css/editor.css +++ b/src/components/BootstrapBlazor.SummerNote/wwwroot/css/editor.css @@ -1,4 +1,4 @@ -.editor .editor-body { +.editor .editor-body { cursor: pointer; min-height: 50px; height: auto; @@ -58,6 +58,16 @@ display: block; } +.editor.is-invalid .note-frame, +.editor.is-invalid > .form-control { + border: 1px solid var(--bs-danger) !important; +} + +.editor.is-valid .note-frame, +.editor.is-valid > .form-control { + border: 1px solid var(--bs-success) !important; +} + .modal-body .note-form-group:not(:last-child) { margin-bottom: 0.5rem; } From 2f1e8ebf5fafe4f098a974112065dd73fdf62bdc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 8 Nov 2025 09:31:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Editor/Editor.razor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js index a9223e64..82b241c1 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.js @@ -1,4 +1,4 @@ -import '../../js/summernote-bs5.min.js' +import '../../js/summernote-bs5.min.js' import { addLink, addScript } from '../../../BootstrapBlazor/modules/utility.js' import Data from '../../../BootstrapBlazor/modules/data.js' import EventHandler from '../../../BootstrapBlazor/modules/event-handler.js' @@ -175,7 +175,11 @@ export function getCode(id) { } export function reset(id) { - const editor = Data.get(id) + const editor = Data.get(id); + if (!editor.$editor) { + return; + } + const context = editor.$editor.data('summernote') const showSubmit = editor.el.getAttribute("data-bb-submit") === "true" From aef8d4cee642ddaf14e50a2a8006b104baa4ff47 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 8 Nov 2025 09:37:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E7=BB=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Editor/Editor.razor.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs index d1fef60d..ce6d38cf 100644 --- a/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs +++ b/src/components/BootstrapBlazor.SummerNote/Components/Editor/Editor.razor.cs @@ -186,20 +186,10 @@ protected override async Task InvokeInitAsync() /// /// [JSInvokable] - public async Task Update(string value) + public void Update(string value) { - Value = value; - _lastValue = Value; - - if (ValueChanged.HasDelegate) - { - await ValueChanged.InvokeAsync(Value); - } - - if (OnValueChanged != null) - { - await OnValueChanged.Invoke(value); - } + CurrentValue = value; + _lastValue = value; } /// From a4baec6ccf556acac22def707bda426d989029ff Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 8 Nov 2025 09:38:00 +0800 Subject: [PATCH 5/5] chore: bump version 9.0.9 --- .../BootstrapBlazor.SummerNote.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj b/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj index a8482506..4d6acc24 100644 --- a/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj +++ b/src/components/BootstrapBlazor.SummerNote/BootstrapBlazor.SummerNote.csproj @@ -1,7 +1,7 @@ - 9.0.8 + 9.0.9