@@ -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 {
0 commit comments