@using BLAIzor.Models
@using BLAIzor.Services
@using Microsoft.AspNetCore.Components.Authorization
@inject ContentEditorService ContentEditorService
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject CustomAuthenticationStateProvider CustomAuthProvider
@code {
[Parameter] public HtmlSnippet Snippet { get; set; } = new HtmlSnippet();
[Parameter] public EventCallback OnContentUpdated { get; set; }
private bool IsLoading = false;
private string? userId;
private string? userName;
private AuthenticationState? authState;
EventConsole console;
protected override async Task OnParametersSetAsync()
{
authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if (authState.User.Identity?.IsAuthenticated == true)
{
userId = CustomAuthProvider.GetUserId();
userName = CustomAuthProvider.GetUserName();
}
}
async Task OnPaste(HtmlEditorPasteEventArgs args)
{
console.Log($"Paste: {args.Html}");
// await OnContentUpdated.InvokeAsync(MenuItem);
}
async Task OnChange(string html)
{
console.Log($"Change: {html}");
}
async Task OnInput(string html)
{
console.Log($"Input: {html}");
}
void OnExecute(HtmlEditorExecuteEventArgs args)
{
console.Log($"Execute: {args.CommandName}");
}
void OnUploadComplete(UploadCompleteEventArgs args)
{
console.Log($"Upload complete: {args.RawResponse}");
}
}