Refactored components into their own namespace

This commit is contained in:
Thorsten Sommer 2024-08-20 20:25:44 +02:00
parent 54191cb7da
commit e751a22bd2
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
63 changed files with 43 additions and 50 deletions

View File

@ -9,5 +9,4 @@
@using AIStudio @using AIStudio
@using AIStudio.Tools @using AIStudio.Tools
@using AIStudio.Components @using AIStudio.Components
@using AIStudio.Components.Blocks
@using MudBlazor @using MudBlazor

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class AssistantBlock : ComponentBase public partial class AssistantBlock : ComponentBase
{ {

View File

@ -1,3 +0,0 @@
namespace AIStudio.Components.Blocks;
public interface ITreeItem;

View File

@ -1,3 +0,0 @@
namespace AIStudio.Components.Blocks;
public readonly record struct TreeDivider : ITreeItem;

View File

@ -1,4 +1,4 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Changelog public partial class Changelog
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Changelog : ComponentBase public partial class Changelog : ComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
/// <summary> /// <summary>
/// Configuration component for any boolean option. /// Configuration component for any boolean option.

View File

@ -3,7 +3,7 @@ using AIStudio.Tools;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver, IDisposable public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver, IDisposable
{ {

View File

@ -2,7 +2,7 @@ using AIStudio.Settings;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
/// <summary> /// <summary>
/// Configuration component for selecting a value from a list. /// Configuration component for selecting a value from a list.

View File

@ -2,7 +2,7 @@ using System.Numerics;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ConfigurationSlider<T> : ConfigurationBase where T : struct, INumber<T> public partial class ConfigurationSlider<T> : ConfigurationBase where T : struct, INumber<T>
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ConfigurationText : ConfigurationBase public partial class ConfigurationText : ConfigurationBase
{ {

View File

@ -2,7 +2,7 @@ using AIStudio.Settings;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class EnumSelection<T> : EnumSelectionBase where T : struct, Enum public partial class EnumSelection<T> : EnumSelectionBase where T : struct, Enum
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public abstract class EnumSelectionBase : ComponentBase public abstract class EnumSelectionBase : ComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ExpansionPanel : ComponentBase public partial class ExpansionPanel : ComponentBase
{ {

View File

@ -0,0 +1,3 @@
namespace AIStudio.Components;
public interface ITreeItem;

View File

@ -3,7 +3,7 @@ using AIStudio.Tools;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class InnerScrolling : MSGComponentBase public partial class InnerScrolling : MSGComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Issues : ComponentBase public partial class Issues : ComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Motivation : ComponentBase public partial class Motivation : ComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class MudTextList : ComponentBase public partial class MudTextList : ComponentBase
{ {

View File

@ -2,7 +2,7 @@ using System.Numerics;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class MudTextSlider<T> : ComponentBase where T : struct, INumber<T> public partial class MudTextSlider<T> : ComponentBase where T : struct, INumber<T>
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class MudTextSwitch : ComponentBase public partial class MudTextSwitch : ComponentBase
{ {

View File

@ -2,7 +2,7 @@ using AIStudio.Tools;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ProcessComponent<T> : ComponentBase where T : struct, Enum public partial class ProcessComponent<T> : ComponentBase where T : struct, Enum
{ {

View File

@ -2,7 +2,7 @@ using AIStudio.Settings;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ProviderSelection : ComponentBase public partial class ProviderSelection : ComponentBase
{ {

View File

@ -5,7 +5,7 @@ using AIStudio.Tools;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ReadWebContent : ComponentBase public partial class ReadWebContent : ComponentBase
{ {

View File

@ -1,4 +1,4 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public enum ReadWebContentSteps public enum ReadWebContentSteps
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class SplitButton<T> : ComponentBase public partial class SplitButton<T> : ComponentBase
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class ThirdPartyComponent : ComponentBase public partial class ThirdPartyComponent : ComponentBase
{ {

View File

@ -1,3 +1,3 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public readonly record struct TreeButton(WorkspaceBranch Branch, int Depth, string Text, string Icon, Func<Task> Action) : ITreeItem; public readonly record struct TreeButton(WorkspaceBranch Branch, int Depth, string Text, string Icon, Func<Task> Action) : ITreeItem;

View File

@ -0,0 +1,3 @@
namespace AIStudio.Components;
public readonly record struct TreeDivider : ITreeItem;

View File

@ -1,4 +1,4 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public class TreeItemData : ITreeItem public class TreeItemData : ITreeItem
{ {
@ -8,7 +8,7 @@ public class TreeItemData : ITreeItem
public string Text { get; init; } = string.Empty; public string Text { get; init; } = string.Empty;
public string ShortenedText => Text.Length > 30 ? this.Text[..30] + "..." : this.Text; public string ShortenedText => this.Text.Length > 30 ? this.Text[..30] + "..." : this.Text;
public string Icon { get; init; } = string.Empty; public string Icon { get; init; } = string.Empty;

View File

@ -1,4 +1,4 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public enum TreeItemType public enum TreeItemType
{ {

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Vision : ComponentBase public partial class Vision : ComponentBase
{ {

View File

@ -1,4 +1,4 @@
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public enum WorkspaceBranch public enum WorkspaceBranch
{ {

View File

@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Components;
using DialogOptions = AIStudio.Dialogs.DialogOptions; using DialogOptions = AIStudio.Dialogs.DialogOptions;
namespace AIStudio.Components.Blocks; namespace AIStudio.Components;
public partial class Workspaces : ComponentBase public partial class Workspaces : ComponentBase
{ {

View File

@ -1,12 +1,7 @@
@using System.Net.Http @using Microsoft.AspNetCore.Components.Forms
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using AIStudio @using AIStudio
@using AIStudio.Components
@using AIStudio.Components.Blocks
@using MudBlazor @using MudBlazor

View File

@ -7,5 +7,4 @@
@using AIStudio @using AIStudio
@using AIStudio.Tools @using AIStudio.Tools
@using AIStudio.Components @using AIStudio.Components
@using AIStudio.Components.Blocks
@using MudBlazor @using MudBlazor

View File

@ -1,6 +1,5 @@
using AIStudio.Chat; using AIStudio.Chat;
using AIStudio.Components; using AIStudio.Components;
using AIStudio.Components.Blocks;
using AIStudio.Dialogs; using AIStudio.Dialogs;
using AIStudio.Provider; using AIStudio.Provider;
using AIStudio.Settings; using AIStudio.Settings;

View File

@ -1,7 +1,9 @@
using AIStudio.Components.Blocks; using AIStudio.Components;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Changelog = AIStudio.Components.Changelog;
namespace AIStudio.Pages; namespace AIStudio.Pages;
public partial class Home : ComponentBase public partial class Home : ComponentBase

View File

@ -7,5 +7,4 @@
@using AIStudio @using AIStudio
@using AIStudio.Tools @using AIStudio.Tools
@using AIStudio.Components @using AIStudio.Components
@using AIStudio.Components.Blocks
@using MudBlazor @using MudBlazor

View File

@ -1,7 +1,7 @@
@using AIStudio.Provider @using AIStudio.Provider
@using AIStudio.Provider.SelfHosted @using AIStudio.Provider.SelfHosted
@using MudBlazor @using MudBlazor
@using AIStudio.Components.Blocks @using AIStudio.Components
<MudDialog> <MudDialog>
<DialogContent> <DialogContent>

View File

@ -370,11 +370,11 @@ def update_changelog []: nothing -> nothing {
let code = ($"LOGS = \n($tab)[\n($code_rows)\n($tab)];") let code = ($"LOGS = \n($tab)[\n($code_rows)\n($tab)];")
# Next, update the Changelog.Logs.cs file: # Next, update the Changelog.Logs.cs file:
let changelog_logs_source_file = open --raw "Components/Blocks/Changelog.Logs.cs" let changelog_logs_source_file = open --raw "Components/Changelog.Logs.cs"
let result = $changelog_logs_source_file | str replace --regex '(?ms)LOGS =\s+\[[\w\s".,-:()?]+\];' $code let result = $changelog_logs_source_file | str replace --regex '(?ms)LOGS =\s+\[[\w\s".,-:()?]+\];' $code
# Save the updated file: # Save the updated file:
$result | save --raw --force "Components/Blocks/Changelog.Logs.cs" $result | save --raw --force "Components/Changelog.Logs.cs"
let number_change_logs = $table | length let number_change_logs = $table | length
print $"Updated Changelog.Logs.cs with ($number_change_logs) change logs." print $"Updated Changelog.Logs.cs with ($number_change_logs) change logs."