diff --git a/blazor-toc.html b/blazor-toc.html index 1f8dbcfab2..b2e75f1163 100644 --- a/blazor-toc.html +++ b/blazor-toc.html @@ -170,6 +170,17 @@
|
+ |
+
+
+
+
+
+
+
+ @card.Title
+
+
+
|
+ |||||||||||||||
| ID | +
+ |
+
| Category | +
+ |
+
| Title | +
+ |
+
| Size | +
+ |
+
| Description | +
+ |
+
| Deliver | +
+ |
+
| Feedback | +
+ |
+
Integrate the AI assistant into the rich text editor by capturing the content from the editor, sending it to the AI service, and displaying the results or suggestions back in the editor.
This function condenses the selected content into a brief summary, capturing the main points succinctly.
This function expands the selected content, adding additional details and context.
This function rewrites the selected content to convey the same meaning using different words or structures. It also enables rephrase options and disables language selection.
This function reviews and corrects the grammar of the selected content, ensuring it adheres to standard grammatical rules.
This function translates the selected content into the specified language, enabling language selection and disabling rephrase options.
"; + private bool dialogVisible { get; set; } + private bool enabelAIAssitantButton { get; set; } = false; + private bool enabelRegenerateContentButton { get; set; } = false; + private bool enabelContentButton { get; set; } = true; + private string promptQuery = string.Empty; + private string subQuery = string.Empty; + private string[] chipValue = new[] { "Standard" }; + private string translatelanguage = "EN"; + private string dropVal { get; set; } = "Rephrase"; + private bool enableRephraseChips { get; set; } = true; + private bool enableLanguageList { get; set; } = false; + private bool noResultsFound { get; set; } = false; + public bool isContentGenerating { get; set; } = true; + private string AIResult { get; set; } = string.Empty; + private bool isSentimentCheck { get; set; } = false; + private MarkdownPipeline pipeline { get; set; } = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); + private string sentiment = ""; + private string apiResultData = ""; + private string ButtonClass = "e-tbar-btn"; + private void UpdateStatus(Syncfusion.Blazor.RichTextEditor.ChangeEventArgs args) + { + Value = args.Value; + enabelAIAssitantButton = string.IsNullOrWhiteSpace(Value); + } + private void OnActionCompleteHandler(Syncfusion.Blazor.RichTextEditor.ActionCompleteEventArgs args) + { + if (args.RequestType == "SourceCode") + { + this.ButtonClass = "e-tbar-btn e-overlay"; + } + if (args.RequestType == "Preview") + { + this.ButtonClass = "e-tbar-btn"; + } + } + private void UpdateTextAreaStatus(InputEventArgs args) + { + Value = args.Value; + enabelRegenerateContentButton = string.IsNullOrWhiteSpace(Value); + } + private async Task AIQuerySelectedMenu(MenuEventArgs args) + { + await DialogueOpen(args.Item.Text); + } + private async Task Rephrase() + { + await DialogueOpen("Rephrase"); + } + private async Task DialogueOpen(string selectedQuery) + { + var selectionText = await rteObj.GetSelectedHtmlAsync(); + if (!string.IsNullOrEmpty(selectionText)) + { + dialogVisible = true; + dropVal = QueryList.FirstOrDefault(q => q.Text.Equals(selectedQuery, StringComparison.OrdinalIgnoreCase))?.ID; + promptQuery = selectionText; + await this.rteObj.SaveSelectionAsync(); + await this.leftRteChildObj.RefreshUIAsync(); + await UpdateAISuggestionsData(selectedQuery); + } + else + { + await this.ToastObj.ShowAsync(new ToastModel { ContentTemplate = @GetTemplate(true), ShowCloseButton = true, Timeout = 0 }); + } + } + private async Task SelectedChipsChanged(Syncfusion.Blazor.Buttons.SelectionChangedEventArgs args) + { + if (chipValue.Length == 0 && args != null && args.RemovedItems.Length > 0) + { + chipValue = new [] { args.RemovedItems[0] }; + } + await UpdateAISuggestionsData("Rephrase"); + } + private async Task AITranslateDropdownList(ChangeEventArgs