mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 15:19: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
|
||||||
@using AIStudio.Tools
|
@using AIStudio.Tools
|
||||||
@using AIStudio.Components
|
@using AIStudio.Components
|
||||||
@using AIStudio.Components.Blocks
|
|
||||||
@using MudBlazor
|
@using MudBlazor
|
@ -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
|
||||||
{
|
{
|
@ -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
|
public partial class Changelog
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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.
|
@ -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
|
||||||
{
|
{
|
@ -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.
|
@ -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>
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
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;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace AIStudio.Components.Blocks;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public partial class InnerScrolling : MSGComponentBase
|
public partial class InnerScrolling : MSGComponentBase
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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>
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace AIStudio.Components.Blocks;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public enum ReadWebContentSteps
|
public enum ReadWebContentSteps
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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;
|
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
|
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;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
namespace AIStudio.Components.Blocks;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public enum TreeItemType
|
public enum TreeItemType
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace AIStudio.Components.Blocks;
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
public enum WorkspaceBranch
|
public enum WorkspaceBranch
|
||||||
{
|
{
|
@ -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
|
||||||
{
|
{
|
@ -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
|
@ -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
|
@ -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;
|
||||||
|
@ -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
|
||||||
|
@ -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
|
@ -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>
|
||||||
|
@ -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."
|
||||||
|
Loading…
Reference in New Issue
Block a user