Skip to content

Commit d9f7956

Browse files
added some missing doc block comments and bumped version
1 parent 263d128 commit d9f7956

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/Tizzani.MudBlazor.HtmlEditor/MudHtmlEditor.razor.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,66 @@ public sealed partial class MudHtmlEditor : IAsyncDisposable
1616
[Parameter]
1717
public RenderFragment? ChildContent { get; set; }
1818

19+
/// <summary>
20+
/// Whether or not to ourline the editor. Default value is <see langword="true" />.
21+
/// </summary>
1922
[Parameter]
2023
public bool Outlined { get; set; } = true;
2124

25+
/// <summary>
26+
/// The placeholder text to display when the editor has not content.
27+
/// </summary>
2228
[Parameter]
2329
public string Placeholder { get; set; } = "Tell your story...";
2430

31+
/// <summary>
32+
/// The HTML markup from the editor.
33+
/// </summary>
2534
[Parameter]
2635
public string Html { get; set; } = "";
2736

37+
/// <summary>
38+
/// Raised when the <see cref="Html"/> property changes.
39+
/// </summary>
2840
[Parameter]
2941
public EventCallback<string> HtmlChanged { get; set; }
3042

43+
/// <summary>
44+
/// The plain-text content from the editor.
45+
/// </summary>
3146
[Parameter]
3247
public string Text { get; set; } = "";
3348

49+
/// <summary>
50+
/// Raised when the <see cref="Text"/> property changes.
51+
/// </summary>
3452
[Parameter]
3553
public EventCallback<string> TextChanged { get; set; }
3654

55+
/// <summary>
56+
/// Whether or not the user can resize the editor. Default value is <see langword="true" />.
57+
/// </summary>
3758
[Parameter]
3859
public bool Resizable { get; set; } = true;
3960

61+
/// <summary>
62+
/// Captures html attributes and applies them to the editor.
63+
/// </summary>
4064
[Parameter(CaptureUnmatchedValues = true)]
4165
public IDictionary<string, object?>? UserAttributes { get; set; }
4266

67+
68+
/// <summary>
69+
/// Clears the content of the editor.
70+
/// </summary>
4371
public async Task Reset()
4472
{
4573
await SetHtml(string.Empty);
4674
}
4775

76+
/// <summary>
77+
/// Sets the HTML content of the editor to the specified <paramref name="html"/>.
78+
/// </summary>
4879
public async Task SetHtml(string html)
4980
{
5081
if (_quill is not null)
@@ -54,17 +85,25 @@ public async Task SetHtml(string html)
5485
HandleTextContentChanged(await GetText());
5586
}
5687

88+
/// <summary>
89+
/// Gets the current HTML content of the editor.
90+
/// </summary>
5791
public async Task<string> GetHtml()
5892
{
5993
if (_quill is not null)
6094
return await _quill.InvokeAsync<string>("getHtml");
95+
6196
return "";
6297
}
6398

99+
/// <summary>
100+
/// Gets the current plain-text content of the editor.
101+
/// </summary>
64102
public async Task<string> GetText()
65103
{
66104
if (_quill is not null)
67105
return await _quill.InvokeAsync<string>("getText");
106+
68107
return "";
69108
}
70109

@@ -83,6 +122,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
83122
}
84123
}
85124

125+
86126
[JSInvokable]
87127
public async void HandleHtmlContentChanged(string html)
88128
{

src/Tizzani.MudBlazor.HtmlEditor/Tizzani.MudBlazor.HtmlEditor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<RepositoryUrl>https://github.com/erinnmclaughlin/MudBlazor.HtmlEditor</RepositoryUrl>
1010
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
12-
<Version>2.1.0</Version>
12+
<Version>2.2.0</Version>
1313
<Description>A customizable HTML editor component for MudBlazor, powered by QuillJS.</Description>
1414
<Copyright>2024 Erin McLaughlin</Copyright>
1515
<PackageProjectUrl>https://github.com/erinnmclaughlin/MudBlazor.HtmlEditor</PackageProjectUrl>

0 commit comments

Comments
 (0)