remove AI integration and account limits
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Wino.Mail.WinUI.Controls;
|
||||
|
||||
public interface IAiHtmlActionHost
|
||||
{
|
||||
Task<string?> GetCurrentHtmlAsync(CancellationToken cancellationToken);
|
||||
Task ApplyHtmlResultAsync(string html, CancellationToken cancellationToken);
|
||||
Task<string?> TryGetCachedTranslationHtmlAsync(string languageCode, CancellationToken cancellationToken);
|
||||
Task SaveCachedTranslationHtmlAsync(string languageCode, string html, CancellationToken cancellationToken);
|
||||
Task<string?> TryGetCachedSummaryTextAsync(CancellationToken cancellationToken);
|
||||
Task SaveCachedSummaryTextAsync(string summary, CancellationToken cancellationToken);
|
||||
string GetSuggestedSummaryFileName();
|
||||
}
|
||||
@@ -8,7 +8,6 @@ using CommunityToolkit.WinUI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
@@ -22,7 +21,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
{
|
||||
private const string MailOperationTemplateKey = "OperationCommandBarMailOperationTemplate";
|
||||
private const string FolderOperationTemplateKey = "OperationCommandBarFolderOperationTemplate";
|
||||
private const string AIActionsTemplateKey = "OperationCommandBarAIActionsTemplate";
|
||||
private const string PopOutTemplateKey = "OperationCommandBarThemeToggleTemplate";
|
||||
private const string ThemeToggleTemplateKey = "OperationCommandBarThemeToggleTemplate";
|
||||
private const string SeparatorTemplateKey = "OperationCommandBarSeparatorTemplate";
|
||||
@@ -36,12 +34,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
[GeneratedDependencyProperty]
|
||||
public partial ICommand? ItemInvokedCommand { get; set; }
|
||||
|
||||
[GeneratedDependencyProperty]
|
||||
public partial bool IsAIActionsEnabled { get; set; }
|
||||
|
||||
[GeneratedDependencyProperty]
|
||||
public partial bool IsAIActionsPaneToggleVisible { get; set; }
|
||||
|
||||
[GeneratedDependencyProperty]
|
||||
public partial bool IsEditorThemeDark { get; set; }
|
||||
|
||||
@@ -51,7 +43,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
[GeneratedDependencyProperty]
|
||||
public partial bool IsPopOutButtonVisible { get; set; }
|
||||
|
||||
public event EventHandler<bool>? AIActionsEnabledChanged;
|
||||
public event EventHandler? PopOutClicked;
|
||||
|
||||
public OperationCommandBar()
|
||||
@@ -84,16 +75,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
RefreshCommands();
|
||||
}
|
||||
|
||||
partial void OnIsAIActionsEnabledChanged(bool newValue)
|
||||
{
|
||||
AIActionsEnabledChanged?.Invoke(this, newValue);
|
||||
}
|
||||
|
||||
partial void OnIsAIActionsPaneToggleVisibleChanged(bool newValue)
|
||||
{
|
||||
RefreshCommands();
|
||||
}
|
||||
|
||||
partial void OnIsEditorThemeDarkChanged(bool newValue)
|
||||
{
|
||||
RefreshCommands();
|
||||
@@ -215,11 +196,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
{
|
||||
ClearGeneratedCommands();
|
||||
|
||||
if (IsAIActionsPaneToggleVisible)
|
||||
{
|
||||
PrimaryCommands.Add(CreateAIActionsToggleButton());
|
||||
}
|
||||
|
||||
if (IsPopOutButtonVisible)
|
||||
{
|
||||
PrimaryCommands.Add(CreatePopOutButton());
|
||||
@@ -277,9 +253,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
button.Click -= ThemeButton_Click;
|
||||
button.Click -= PopOutButton_Click;
|
||||
break;
|
||||
case AppBarToggleButton toggleButton:
|
||||
toggleButton.ClearValue(AppBarToggleButton.IsCheckedProperty);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,22 +310,6 @@ public sealed partial class OperationCommandBar : CommandBar
|
||||
return null;
|
||||
}
|
||||
|
||||
private AppBarToggleButton CreateAIActionsToggleButton()
|
||||
{
|
||||
var button = (AppBarToggleButton)LoadCommandBarElementTemplate(
|
||||
AIActionsTemplateKey,
|
||||
new OperationCommandBarAIActionsItemViewModel(Translator.Composer_AiActions, "\uE945"));
|
||||
|
||||
button.SetBinding(AppBarToggleButton.IsCheckedProperty, new Binding
|
||||
{
|
||||
Mode = BindingMode.TwoWay,
|
||||
Path = new PropertyPath(nameof(IsAIActionsEnabled)),
|
||||
Source = this
|
||||
});
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
private AppBarButton CreateThemeToggleButton()
|
||||
{
|
||||
var label = IsEditorThemeDark ? Translator.Composer_LightTheme : Translator.Composer_DarkTheme;
|
||||
@@ -487,18 +444,6 @@ public sealed class OperationCommandBarMenuOperationItemViewModel
|
||||
public CommandBarLabelPosition LabelPosition { get; }
|
||||
}
|
||||
|
||||
public sealed class OperationCommandBarAIActionsItemViewModel
|
||||
{
|
||||
public OperationCommandBarAIActionsItemViewModel(string toolTip, string glyph)
|
||||
{
|
||||
ToolTip = toolTip;
|
||||
Glyph = glyph;
|
||||
}
|
||||
|
||||
public string ToolTip { get; }
|
||||
public string Glyph { get; }
|
||||
}
|
||||
|
||||
public sealed class OperationCommandBarThemeItemViewModel
|
||||
{
|
||||
public OperationCommandBarThemeItemViewModel(string toolTip, WinoIconGlyph icon)
|
||||
|
||||
Reference in New Issue
Block a user