mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 15:39:46 +00:00
Refactored components into their own namespace
This commit is contained in:
parent
54191cb7da
commit
e751a22bd2
@ -9,5 +9,4 @@
|
||||
@using AIStudio
|
||||
@using AIStudio.Tools
|
||||
@using AIStudio.Components
|
||||
@using AIStudio.Components.Blocks
|
||||
@using MudBlazor
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class AssistantBlock : ComponentBase
|
||||
{
|
@ -1,3 +0,0 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
|
||||
public interface ITreeItem;
|
@ -1,3 +0,0 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
|
||||
public readonly record struct TreeDivider : ITreeItem;
|
@ -1,4 +1,4 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Changelog
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Changelog : ComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration component for any boolean option.
|
@ -3,7 +3,7 @@ using AIStudio.Tools;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver, IDisposable
|
||||
{
|
@ -2,7 +2,7 @@ using AIStudio.Settings;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration component for selecting a value from a list.
|
@ -2,7 +2,7 @@ using System.Numerics;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ConfigurationSlider<T> : ConfigurationBase where T : struct, INumber<T>
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ConfigurationText : ConfigurationBase
|
||||
{
|
@ -2,7 +2,7 @@ using AIStudio.Settings;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class EnumSelection<T> : EnumSelectionBase where T : struct, Enum
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public abstract class EnumSelectionBase : ComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ExpansionPanel : ComponentBase
|
||||
{
|
3
app/MindWork AI Studio/Components/ITreeItem.cs
Normal file
3
app/MindWork AI Studio/Components/ITreeItem.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public interface ITreeItem;
|
@ -3,7 +3,7 @@ using AIStudio.Tools;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class InnerScrolling : MSGComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Issues : ComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Motivation : ComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class MudTextList : ComponentBase
|
||||
{
|
@ -2,7 +2,7 @@ using System.Numerics;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class MudTextSlider<T> : ComponentBase where T : struct, INumber<T>
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class MudTextSwitch : ComponentBase
|
||||
{
|
@ -2,7 +2,7 @@ using AIStudio.Tools;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ProcessComponent<T> : ComponentBase where T : struct, Enum
|
||||
{
|
@ -2,7 +2,7 @@ using AIStudio.Settings;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ProviderSelection : ComponentBase
|
||||
{
|
@ -5,7 +5,7 @@ using AIStudio.Tools;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ReadWebContent : ComponentBase
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public enum ReadWebContentSteps
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class SplitButton<T> : ComponentBase
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ThirdPartyComponent : ComponentBase
|
||||
{
|
@ -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;
|
3
app/MindWork AI Studio/Components/TreeDivider.cs
Normal file
3
app/MindWork AI Studio/Components/TreeDivider.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public readonly record struct TreeDivider : ITreeItem;
|
@ -1,4 +1,4 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public class TreeItemData : ITreeItem
|
||||
{
|
||||
@ -8,7 +8,7 @@ public class TreeItemData : ITreeItem
|
||||
|
||||
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;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public enum TreeItemType
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Vision : ComponentBase
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public enum WorkspaceBranch
|
||||
{
|
@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Components;
|
||||
|
||||
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
||||
|
||||
namespace AIStudio.Components.Blocks;
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class Workspaces : ComponentBase
|
||||
{
|
@ -1,12 +1,7 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using AIStudio
|
||||
@using AIStudio.Components
|
||||
@using AIStudio.Components.Blocks
|
||||
@using MudBlazor
|
@ -7,5 +7,4 @@
|
||||
@using AIStudio
|
||||
@using AIStudio.Tools
|
||||
@using AIStudio.Components
|
||||
@using AIStudio.Components.Blocks
|
||||
@using MudBlazor
|
@ -1,6 +1,5 @@
|
||||
using AIStudio.Chat;
|
||||
using AIStudio.Components;
|
||||
using AIStudio.Components.Blocks;
|
||||
using AIStudio.Dialogs;
|
||||
using AIStudio.Provider;
|
||||
using AIStudio.Settings;
|
||||
|
@ -1,7 +1,9 @@
|
||||
using AIStudio.Components.Blocks;
|
||||
using AIStudio.Components;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
using Changelog = AIStudio.Components.Changelog;
|
||||
|
||||
namespace AIStudio.Pages;
|
||||
|
||||
public partial class Home : ComponentBase
|
||||
|
@ -7,5 +7,4 @@
|
||||
@using AIStudio
|
||||
@using AIStudio.Tools
|
||||
@using AIStudio.Components
|
||||
@using AIStudio.Components.Blocks
|
||||
@using MudBlazor
|
@ -1,7 +1,7 @@
|
||||
@using AIStudio.Provider
|
||||
@using AIStudio.Provider.SelfHosted
|
||||
@using MudBlazor
|
||||
@using AIStudio.Components.Blocks
|
||||
@using AIStudio.Components
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
|
@ -370,11 +370,11 @@ def update_changelog []: nothing -> nothing {
|
||||
let code = ($"LOGS = \n($tab)[\n($code_rows)\n($tab)];")
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
print $"Updated Changelog.Logs.cs with ($number_change_logs) change logs."
|
||||
|
Loading…
Reference in New Issue
Block a user